Question: 1-Given that Student is a class, how many reference variables and objects are created by the following code: Student studentName, studentId; studentName = new Student();

1-Given that Student is a class, how many reference variables and objects are created by the following code:

Student studentName, studentId; studentName = new Student(); Student stud_class = new Student();

Select one:

a. Three reference variables and three objects are created.

b. Two reference variables and two objects are created.

c. Three reference variables and two objects are created.

d. One reference variable and two objects are created.

2-

The following class declaration statement:

class Bus implements Vehicle implements Transportation { . . .} is valid in Java.

Select one: True False

3-

The following statement is used only to check for division by zero exception

catch(Exception e)

{

System.err.println(e.toString());

}

Select one: True False

4-

The following is a valid interface definition in Java

public interface Shape {

public double getArea();

public double getPerimeter();

}

Select one: True False

5-

The clone() method defined in the Cloneable interface must throw ArithmeticException.

Select one: True False

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!