Page 1 of 1

About Question enthuware.ocajp.i.v7.2.1340 :

Posted: Tue Dec 11, 2012 4:18 pm
by ETS User
Hi,
In this eg. if I try invoking the sum() as sum(10,10); it throws a compiler error that methods are ambiguous.

Though you cld invoke with sum(10,10L) etc.. so this wont be a problem.

But then is this a good eg. to test for overloading?

Thanks.

Re: About Question enthuware.ocajp.i.v7.2.1340 :

Posted: Tue Dec 11, 2012 7:02 pm
by admin
It is definitely overloading. But I wouldn't call it a good coding practice.

HTH,
Paul.