What Will Be The Output Of The Following Java Codep Pre #220
What will be the output of the following Java code?</p> <pre><code class="language-java" line="1"> class test { int a; int b; test(int i, int j) { a = i; b = j; } void meth(test o) { o.a *= 2; o.b /= 2; } } class Output { public static void main(String args[]) { test obj = new test(10 , 20); obj.meth(obj); System.out.println(obj.a + " " + obj.b); } }</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 - Overloading Methods & Argument Passing in Java - Quiz No.1.