Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
32 lines (26 loc) · 814 Bytes

File metadata and controls

32 lines (26 loc) · 814 Bytes
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
package MethodOverloading;
public class TestMethod2 {
static void add(int a, double d){
System.out.println("Argument type (int , double)");
}
static void add(double d, int a){
System.out.println("Argument type (double, int)");
}
static void add(double d, double a){
System.out.println("Argument type (double, double)");
}
static void add(int a, float f){
System.out.println("Argument type (int , float)");
}
static void add(float f, int a){
System.out.println("Argument type (float, int)");
}
public static void main(String... args){
//add(10,20); is a ambiguous CTE;
// because he can't able to decide which argument he will take as double or int
// as there exists two methods with args (int, double) and (double, int)
//add(12,13);
add(10,20.0);
add(10.0f,10);
}
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.