What Will Be The Output Of The Following Java Codep Pre #188
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; 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(); } }</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.