What Will Be The Output Of The Following Java Codep Pre #216

What will be the output of the following Java code?</p> <pre><code class="language-java" line="1"> class overload { int x; int y; void add(int a) { x = a + 1; } void add(int a, int b) { x = a + 2; } } class Overload_methods { public static void main(String args[]) { overload obj = new overload(); int a = 0; obj.add(6); System.out.println(obj.x); } }</code></pre>

Online Quiz 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.


Similar question(s) are as followings:



Online Quizzes of gs128 Java

Choose an organization

Theme Customizer

Gaussian Texture



Gradient Background