Question: Trying to figure out why this sint compiling... (Java) import java.text.DecimalFormat; public class TestCircle { public static void main(String[] args) { DecimalFormat showTwoDecimals = new
Trying to figure out why this sint compiling... (Java)
import java.text.DecimalFormat;
public class TestCircle
{
public static void main(String[] args)
{
DecimalFormat showTwoDecimals = new DecimalFormat( "0.00" );
Circle c1 = new Circle(2.5, 22, 44);
System.out.println("This shape is a " + c1.getName() +
" located at " + c1.getLocation() +
" Radius is " + c1.getRadius());
System.out.println("The shape area is: " + showTwoDecimals.format(c1.area())+" ");
c1.setRadius(4.25);
System.out.println(" The changed shape is: " +
c1 + " Area is " + showTwoDecimals.format(c1.area())+" ");
}
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
