Question: 10.A class is a blueprint or a template to create objects of identical type. a.False b.True 11.What is the output of the following program code

10.A class is a blueprint or a template to create objects of identical type.

a.False

b.True

11.What is the output of the following program code ?

double cost = -45;

try{

if ( cost < 0)

throw new RuntimeException( Invalid Cost );

} catch(RuntimeException e){

System.out.print(e.getMessage());

}

System.out.println("Stop Program");

a.No output

b.Invalid Cost Stop Program

c.Stop Program

d.Invalid Cost

12.Analysis the following class definition and answer the following question.

class Test{

double mark;

void setMark (double m){

mark = m; }

private double calTotal(){

return mark * 0.5; }

void display(){

System.out.println(mark);

}}

What is the access specifier of the class?

a.Public

b.Special

c.Protected

d.Private

13.Which is a relational operator in Java?

a.%

b.+

c.==

d.;

14.What is the output of the following program code?

int id = 0;

try{

if (id == 0)

throw new RuntimeException(id is zero );

} catch(RuntimeException e){

System.out.print(e.getMessage());

}

finally{

System.out.println("Close Program");

}

a.Close Program

b.No output

c.id is zero

d.id is zero Close Program

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!