What Will Be The Output Of The Following Java Codep Pre #553
What will be the output of the following Java code?</p> <pre><code class="language-java"> import java.util.*; public class Main { int a, b; Main(int a, int b) { this.a = a; this.b = b; } void area() { System.out.println(a*b); } public static void main(String[] args) { int height = 10; int breadth = 20; Main a = new Main(height, breadth); Main b = a; a.a = 30; b.b = 40; b.area(); } }</code></pre>
This multiple choice question (MCQ) is related to the book/course
gs gs111 OOP Object Oriented Programming Java.
It can also be found in
gs gs111 Class Components (Using Java) - Assigning Objects - Quiz No.1.