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

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
ETS User

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

Post 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.

admin
Site Admin
Posts: 10386
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post by admin »

It is definitely overloading. But I wouldn't call it a good coding practice.

HTH,
Paul.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 13 guests