Multiple Choice
Consider the following class definition. public class Cylinder {private double baseRadius; private double height; public Cylinder () {baseRadius = 0; height = 0;} public Cylinder (double l, double h) {baseRadius = l; height = h;} public void set(double r, double h) {baseRadius = r; height = h;} public String toString() {return (baseRadius + " " + height) ;} public double SurfaceArea() {return 2 * 3.14 * baseRadius * height;} public double volume() {return 3.14 * baseRadius * baseRadius * height;}} Suppose that you have the following declaration. Cylinder cyl = new Cylinder(1.5, 10) ; Which of the following sets of statements are valid in Java? (i) cyl.surfaceArea() ; cyl.volume() ; cyl.print() ; (ii) print(cyl.surfaceArea) ; print(cyl.volume() ) ;
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
Q45: Consider the following statements. public class Circle
Q46: What is the default definition of the
Q47: The non-static methods of a class are
Q49: If a member of a class is
Q50: A constructor has no type and is