class Dog3 {
static void go(long x) { System.out.print("int "); }
static void go(int x) { System.out.print("double "); }
static void go(double...x) { System.out.print("double "); }
public static void main(String[] args) {
Dog3 d = new Dog3();
double b = 5;
double s = 5;
int l = 5;
float f = 5.0f;
go(b);
go(s);
go(l);
go(f);
}
}
output
ouble double double double .How?
my expected output
ouble double int double
As per my knowledge,
1)first matching occurs by the use of primitives,it can be widening in some cases.
2)then boxing
3)then var-args
Regards
Kirba
Plase correct me if iam wrong.