Question: What is the output of the Computer program? A. computer-laptop B. laptop-computer C. laptop-laptop D. The code does not compile. E. None of the above.

What is the output of the Computer program? 

class Laptop extends Computer { public void startup() { System.out.print("laptop-"); } }

A. computer-laptop

B. laptop-computer

C. laptop-laptop

D. The code does not compile.

E. None of the above.

class Laptop extends Computer { public void startup() { System.out.print("laptop-"); } } public class Computer { public void startup() { } System.out.print("computer-"); } public static void main(String[] args) { Computer computer = new Laptop(); Laptop laptop = new Laptop(); computer.startup (); laptop.startup (); }

Step by Step Solution

3.46 Rating (156 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

It appears that youve provided an image of a Java program with two classes Computer and Laptop where ... View full answer

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 Oracle Questions!