Engineering Full Stack Apps with Java and JavaScript
Given:
class OverloadingTest{ void m1(int x){ System.out.println("m1 int"); } void m1(double x){ System.out.println("m1 double"); } void m1(String x){ System.out.println("m1 String"); } } public class TestClass { public static void main(String[] args) throws Exception { OverloadingTest ot = new OverloadingTest(); ot.m1(1.0); } }
What will be the output?
Select 1 option
A. It will fail to compile.
B. m1 int
C. m1 double
D. m1 String