| Author |
Can we have two methods in a class with sama name but different return type?
|
Nagaraj Shivaklara
Ranch Hand
Joined: Dec 16, 2008
Posts: 72
|
|
Hi All,
Can we have two methods with same name but different return types in a class ?
|
Thanks n Regards,
Nagaraj S K
|
 |
Seetharaman Venkatasamy
Ranch Hand
Joined: Jan 28, 2008
Posts: 5575
|
|
what is your opinion? you cant have two methods with same signature[name and parameter] in a class
just for an information : however,Nested class can have a method which is already defined in Outer class, but it is different
|
 |
Nagaraj Shivaklara
Ranch Hand
Joined: Dec 16, 2008
Posts: 72
|
|
Thank you Seetharam.
Seetharaman Venkatasamy wrote:what is your opinion? you cant have two methods with same signature[name and parameter] in a class
just for an information : however,Nested class can have a method which is already defined in Outer class, but it is different 
|
 |
Seetharaman Venkatasamy
Ranch Hand
Joined: Jan 28, 2008
Posts: 5575
|
|
Nagaraj Shivaklara wrote:Thank you Seetharam.
you are welcome
so, in your case you are concern with only method *name* insteadof signature, so overloading[reusing name] is possible .
|
 |
Nagaraj Shivaklara
Ranch Hand
Joined: Dec 16, 2008
Posts: 72
|
|
Hi Seetharaman,
Thank you, also i posted one exception which i am getting while doing struts project(under Application Frameworks ยป Struts) ..
Can you please help me with that?
Seetharaman Venkatasamy wrote:
Nagaraj Shivaklara wrote:Thank you Seetharam.
you are welcome
so, in your case you are concern with only method *name* insteadof signature, so overloading[reusing name] is possible .
|
 |
 |
|
|
subject: Can we have two methods in a class with sama name but different return type?
|
|
|