Page 1 of 1

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

Posted: Fri Jul 26, 2013 6:55 am
by Wisevolk
Test Explanation for answer 2 : "Two methods having same parameters can't have different return types."

Is that the right/good explanation ? I think the good answer should be "can't compile" or the "Two methods can't have the same parameters in a class definition.

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

Posted: Fri Jul 26, 2013 7:10 am
by admin
You are right. The explanation has been enhanced to:
You cannot have two methods with the same signature (i.e. same name and same parameter list) in the same class.
Note that return type and names of the parameters don't matter while determining the signature.
thank you for your feedback!

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

Posted: Fri Jul 26, 2013 8:21 am
by Wisevolk
;)
you're welcome