Examlex

Solved

Consider the Following Statements

question 45

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


Definitions:

Unemployment

A situation where an individual who is able and willing to work is unable to find employment.

Low Self-esteem

A state wherein an individual has a negative perception of oneself, often marked by feelings of inadequacy or unworthiness.

Negative Feedback

A process in which a system responds in a way that reduces the effects of a deviation from a set point, aiming to restore the system to its original state or condition.

Self-esteem

An individual's subjective evaluation of their own worth or value, affecting their confidence and overall mental health.

Related Questions