What Will Be The Output Of The Following Java Codep Pre #186
What will be the output of the following Java code?</p> <pre><code class="language-java" line="1"> class box { int width; int height; int length; int volume; box() { width = 5; height = 5; length = 6; } void volume() { volume = width*height*length; } } class constructor_output { public static void main(String args[]) { box obj = new box(); obj.volume(); System.out.println(obj.volume); } }</code></pre>
This multiple choice question (MCQ) is related to the book/course
gs gs128 Java.
It can also be found in
gs gs128 Java Classes Methods - Constructor & Garbage Collection in Java - Quiz No.1.