using the following data definition classpublic


Using the following data definition class:
public class Circle {
private int radius;
public Circle(int r) {radius = r;}
public int getRadius() {return radius;}
public double area() {return 3.14 * radius * radius;}
}

Indicate in the given code segment if an error occurs. If so, indicate whether it is syntax, runtime or logic and how you would fix it.

public class Use2 {
public static void main (String [] args)
{
Circle round;
fill(round);
System.out.println ("Area: " +
round.area());
}

private static void fill(Circle shape)
{ shape = new Circle (6); }

}

Solution Preview :

Prepared by a verified Expert
JAVA Programming: using the following data definition classpublic
Reference No:- TGS0484639

Now Priced at $10 (50% Discount)

Recommended (97%)

Rated (4.9/5)