Vidyalelo
Java Programming · Q76

Constructors and Methods

Programming · Java Programming · question 76

Q76

What will be the output of the following Java code? class box int width; int height; int length; int volume; void finalize() volume = width*height*length; System.out.println(volume); protected void volume() volume = width*height*length; System.out.println(volume); class Output public static void main(String args[]) box obj = new box(); obj.width=5; obj.height=5; obj.length=6; obj.volume();

A.
150
Answer
B.
200
C.
Run time error
D.
Compilation error

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board