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?

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
It appears that youve provided an image of a Java program with two classes Computer and Laptop where ... View full answer
Get step-by-step solutions from verified subject matter experts
