This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

benefits of extending the Object class loudly

 
Mapraputa Is
Leverager of our synergies
Sheriff
Posts: 10065
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I saw a piece of code that goes like
public class SomeClass extends Object implements java.io.Serializable
Are there some benefits to explicitly state "extends Object" that I might overlook?
[ January 05, 2003: Message edited by: Mapraputa Is ]
 
Marilyn de Queiroz
Sheriff
Posts: 9059
12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Was it in a textbook? Some texts just do that to reinforce the concept that all classes ultimately inherit from Object. It seems to me that Bill Brogden put a statement in ExamPrep Java 2 why he did that, but I can't find it now that I'm looking for it.
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also many IDEs have class wizards that will automatically generate this sort of crap for you. I think it's really only useful for making the situation more obvious to people who barely understand Java (who nonetheless may be expected to maintain your code because a company is too cheap to emply real programmers :roll: ).
 
Mapraputa Is
Leverager of our synergies
Sheriff
Posts: 10065
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Almost textbook, it's a book for beginners. I thought that such extending would only confuse the reader, since this is never done anywhere else[corrected after reading Jim's comment. Ha, so maybe this sort of crap will help to understand IDE-generated code? ] and that all classes extend Object by default isn't such a difficult idea to grasp...
[ January 05, 2003: Message edited by: Mapraputa Is ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic