Examlex

Solved

Consider the Following Statements.public Class Circle

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:

Professors

Senior teachers at colleges or universities who are experts in their field, responsible for lecturing, researching, and guiding students in their academic pursuits.

Social Loafing

The occurrence where people put in less effort while working as part of a group than they do when working independently.

Collective Tasks

Activities or projects that require the joint effort of a group of individuals working together towards a common goal.

Effort

The use of physical or mental energy to achieve a goal or complete a task.

Related Questions