Problem statement: what will be the output of the below code?
class C {
public void run(char a) {
System.out.println("int: " + a);
}
public void run(long a) {
System.out.println("long");
}
}
public class DemoSample1 {
public static void main(String args[]) {
C c = new C();
c.run('9');
}
}
Output:
int: 9
class C {
public void run(char a) {
System.out.println("int: " + a);
}
public void run(long a) {
System.out.println("long");
}
}
public class DemoSample1 {
public static void main(String args[]) {
C c = new C();
c.run('9');
}
}
Output:
int: 9
No comments:
Post a Comment