Page 1 of 1

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

Posted: Mon Jul 09, 2018 6:35 am
by st.lisker
Hello. You said
The second pair of methods will not compile correctly, since their method signatures are same
Is return type not a part of the method signature?
The second pair is:
2.
void perform_work(int time){ }
int perform_work(int speed){return speed ;}

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

Posted: Mon Jul 09, 2018 6:52 am
by admin
No, the return type is never a part of a method signature. Which book are you following? It should have explained that.

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

Posted: Tue Jul 10, 2018 3:47 am
by st.lisker
The book of Mala Gupta . No, it was not there. Thank you! And the order of arguments changes the signature?

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

Posted: Tue Jul 10, 2018 4:00 am
by admin
Yes, order of parameter types is important. parameter names are not important.