JAVA
java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
public class Program
{
private static int i = 0;
public static void main(String[] args) {
Program p = new Program();
p.genericFoo(2);
p.genericFoo("2");
p.Foo(2);
p.Foo("2");
System.out.println(i);
}
public <T> void genericFoo(T t){
i++;
}
public void Foo(int a){
i++;
}
public void Foo(String b){
i++;
}
}
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run