Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Shamkant B. Navathe

7th Edition Global Edition

1292097612, 978-1292097619

More Books

Students also viewed these Databases questions

Question

Question in Computer Science Please Write Correct answer 3 8 .

Answered: 1 week ago