Question: 2 Is the following statement true or false? Justify your answer. All Java interfaces are abstract classes, but not all abstract classes are Java interfaces.

2 Is the following statement true or false? Justify your answer. All Java interfaces are abstract classes, but not all abstract classes are Java interfaces.

2 Is the following statement true or false? Justify your answer. All

What is the running time of the following loop nest?

for(int i = 0; i 0; j--)

System.out.println("hello world");

Fill in exactly one choice.

logarithmic

linear NlogN quadratic

cubic

3. (12 points) Given the following class definition fragments and class instantiations, complete the table below. Assume that the methods shown here do not appear in any other classes. (E.g., The Restaurant class does not define a toString method.) class Building { public Point getLocation() ... } class Restaurant extends Building { public int getSeatCount() ...] class Lab extends Building { public String toString() ...] class Diner extends Restaurant { public boolean equals(Object other) ... } 5. (20 points item in an (a) Give to letter Lab 1 = new Lab(); Restaurant r = new Diner(); Building b = 1; Object o = r; In each blank cell, indicate what would happen if the method in each column is invoked with the object obj in each row. Choose (only one) from the following: compiler error runtime error (i.e., an exception is thrown) X, where X is the class from which the method is called The first row has been done for you, as a example. obj obj.getLocation() obj.getSeatCount() obj.toString() obj.equals(obj) b Building compiler crror Lab Object (b) Briefly o which

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!