Examlex

Solved

Consider the Following Class Definition

question 48

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() ) ;


Definitions:

Influenza

A highly infectious viral illness known for causing seasonal outbreaks and characterized by symptoms such as fever, cough, and body aches.

Gender Responses

The diverse ways individuals react or behave, often based on social or cultural norms associated with gender roles.

Marital Conflict

Disagreements or disputes between married partners, which can affect their relationship and mental health.

Physiologically Reactive

Pertains to the body's natural physical response to stimuli or changes in the environment.

Related Questions