In the following code, radius is private in the Circle class, and myCircle is an object of the Circle class. Does the highlighted code cause any problems? If so, explain why.
public class Circle { private double radius = 1; /** Find the area of this circle */ public double getArea() { return radius * radius * Math.PI; } public static void main(String[] args) { Circle myCircle = new Circle(); System.out.println("Radius is " + myCircle.radius); }}
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.