可以这样写:
System.out.println("周长="+ String.format("%.2f",2*3.14*r));
public static void main (String[] args) { c= Circle() c.r=5 c.getGirth() } }