Multiple Choice
Consider the following statements. public class Circle {private double radius; public Circle() {radius = 0.0;} public Circle(double r) {radius = r;} public void set(double r) {radius = r;} public void print() {System.out.println(radius + " " + area + " " + circumference) ;} public double area() {return 3.14 * radius * radius;} public double circumference() {return 2 * 3.14 * radius;}} Circle myCircle = new Circle() ; double r; Which of the following statements are valid in Java? (Assume that console is Scanner object initialized to the standard input device.) (i) r = console.nextDouble() ; myCircle.area = 3.14 * r * r; System.out.println(myCircle.area) ; (ii) r = console.nextDouble() ; myCircle.set(r) ; System.out.println(myCircle.area() ) ;
A) Only (i)
B) Only (ii)
C) Both (i) and (ii)
D) None of these
Correct Answer:

Verified
Correct Answer:
Verified
Q40: The method finalize automatically executes when the
Q41: Based on the class in the accompanying
Q42: <img src="https://d2lvgg3v3hfg70.cloudfront.net/TB8472/.jpg" alt=" -According to the
Q43: In Java, the reference this is used
Q44: <img src="https://d2lvgg3v3hfg70.cloudfront.net/TB8472/.jpg" alt=" -According to the
Q46: What is the default definition of the
Q47: The non-static methods of a class are
Q48: Consider the following class definition. public class
Q49: If a member of a class is
Q50: A constructor has no type and is