Vidyalelo
Java Programming · Q139

Constructors and Methods

Programming · Java Programming · question 139

Q139

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

A.
0
B.
1
C.
30
D.
error
Answer

Answer: Option D

Solution

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