This week's book giveaway is in the JavaFX forum.
We're giving away four copies of Introducing JavaFX 8 Programming and have Herbert Schildt on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes method overloding Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "method overloding" Watch "method overloding" New topic
Author

method overloding

manohar reddy
Greenhorn

Joined: Oct 13, 2007
Posts: 12
If we have two methods with the same name and same number and type of parameters with different return types. Which of the methods takes the precedence?
Freddy Wong
Ranch Hand

Joined: Sep 11, 2006
Posts: 959

A method can't have the same method name, but different return type.


SCJP 5.0, SCWCD 1.4, SCBCD 1.3, SCDJWS 1.4
My Blog
Olivier Legat
Ranch Hand

Joined: Nov 17, 2007
Posts: 176

You would simply get an error


Olly
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: method overloding
 
jQuery in Action, 3rd edition