What Will Be The Output Of The Following Java Codep Pre #215
What will be the output of the following Java code?</p> <pre><code class="language-java" line="1"> class San { public void m1 (int i,float f) { System.out.println(" int float method"); } public void m1(float f,int i) { System.out.println("float int method"); } public static void main(String[]args) { San s=new San(); s.m1(20,20); } }</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.
What will be the output of the following Java code?
class San { public void m1 (int i,float f) { System.out.println(" int float method"); } public void m1(float f,int i) { System.out.println("float int method"); } public static void main(String[]args) { San s=new San(); s.m1(20,20); } }
int float method
float int method
compile time error
run time error