Skip to content

Commit 65ead2a

Browse files
authored
Add files via upload
1 parent cd36382 commit 65ead2a

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

Methods/VarargsMethodOverloading.java

+14-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ void varargs(int...a)
99
}
1010
}
1111

12-
void varargs(boolean...a) {
12+
/*void varargs(boolean...a) {
1313
System.out.println("METHOD:varargs(boolean...)\tNUMBER OF ARGUMENTS:" + a.length + "\tITEMS:");
1414
for(boolean i:a)
1515
{
@@ -23,7 +23,7 @@ void varargs(String... a) {
2323
{
2424
System.out.println(i+" ");
2525
}
26-
}
26+
}*/
2727

2828
void varargs(float... a) {
2929
System.out.println("METHOD:varargs(float...)\tNUMBER OF ARGUMENTS:" + a.length + "\tITEMS:");
@@ -46,8 +46,18 @@ public static void main(String[] args) {
4646
Test obj=new Test();
4747
obj.varargs("Hello World",10,30,80,90);
4848
obj.varargs(10.9f,8.0f);
49-
obj.varargs(true,false);
50-
obj.varargs("Disha","Argha","World");
49+
//obj.varargs(true,false);
50+
//obj.varargs("Disha","Argha","World");
51+
obj.varargs();/*int is more specific than double. If more than one member method is both accessible and applicable to a method invocation, it is necessary to choose one to provide the descriptor for the run-time method dispatch. The Java programming language uses the rule that the most specific method is chosen according to type promotion. The following rules define the direct supertype relation among the primitive types in this case:
52+
53+
double > float
54+
float > long
55+
long > int
56+
int > char
57+
int > short
58+
short > byte*/
59+
60+
5161
}
5262

5363
}

0 commit comments

Comments
 (0)