This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
My recollection is that the spec doesn't mention overloading explicitly, but it does say that a matching get/set pair will be recognized. Therefore if there's a getter as well as a setter for only one of the overloads, theoretically you should be fine. I can't say what will happen in practice.
Originally posted by Timmy Marks: And of course, you won't be able to have a getter for both!
Joined: Aug 13, 2002
I will test this out and let you know (prob won't be until next week though.)
I'm encountering the problem in Hibernate. I can map to a bean property as long as there is only one set method for that property. I can use either a String or a custom class as my argument, but I can't include both signatures on the same property. I couldn't find anything in the spec that prohibits the use of multiple setters with different arguments, so I am starting to think that the restriction is in Hibernate.