File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes benefits of extending the Object class loudly Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "benefits of extending the Object class loudly" Watch "benefits of extending the Object class loudly" New topic
Author

benefits of extending the Object class loudly

Mapraputa Is
Leverager of our synergies
Sheriff

Joined: Aug 26, 2000
Posts: 10065
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 ]

Uncontrolled vocabularies
"I try my best to make *all* my posts nice, even when I feel upset" -- Philippe Maquet
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9052
    
  12
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.


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
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: ).


"I'm not back." - Bill Harding, Twister
Mapraputa Is
Leverager of our synergies
Sheriff

Joined: Aug 26, 2000
Posts: 10065
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
 
subject: benefits of extending the Object class loudly