Question: What is the output of the Rocket program? A. 2,5 B. 3,4 C. 5,2 D. 3,5 E. The code does not compile. F. None of
What is the output of the Rocket program?

A. 2,5
B. 3,4
C. 5,2
D. 3,5
E. The code does not compile.
F. None of the above.
} package transport; class Ship { } protected int weight = 3; private int height = 5; public int getWeight() { return weight; } public int getHeight() { return height; } public class Rocket extends Ship { public int weight = 2; public int height = 4; public void print Details() { System.out.print(super.getWeight ()+", "+ super.height); } public static final void main(String[] fuel) { new Rocket() .printDetails(); }
Step by Step Solution
3.41 Rating (167 Votes )
There are 3 Steps involved in it
The provided code is a Java program with two classes Ship and Rocket where Rocket extends Ship The R... View full answer
Get step-by-step solutions from verified subject matter experts
