-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDivergentTest.java
More file actions
34 lines (27 loc) · 786 Bytes
/
DivergentTest.java
File metadata and controls
34 lines (27 loc) · 786 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package com.interview.all;
public class DivergentTest {
public void show(Object obj) {
System.out.println("Object");
}
public void show(String string) {
System.out.println("String");
}
public void show(Integer ints) {
System.out.println("Integer");
}
public void show(int ins) {
System.out.println("int");
}
public static void main(String[] args) {
DivergentTest t = new DivergentTest();
t.show("hello"); // Output?
t.show(10); // Output?
t.show(new Integer(10)); // Output?
t.show(3.14); // Output?
// Test t = new Test();
// t.show(null); // Output?
// t.show(10); // Output?
// t.show(new Integer(10)); // Output?
// t.show(3.14); // Output?
}
}