aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes java.lang.Object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "java.lang.Object" Watch "java.lang.Object" New topic
Author

java.lang.Object

shri mon
Ranch Hand

Joined: Jan 11, 2005
Posts: 63
can we write a class that will not extend java.lang.Object?
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
No , it is impicitly extended ...

if you are writing a class A & that class is already extending a class B . and you are thinking that it has one superclass so it can't have another , you are thinking wrong ... because class B is extending Object class . So ultimately class A is a subclass of Object .
Andris Jekabsons
Ranch Hand

Joined: Jan 20, 2004
Posts: 82
No, every Java class extends Object indirectly. You can still write "class A extends Object" but that will have no effect.
Andris
shri mon
Ranch Hand

Joined: Jan 11, 2005
Posts: 63
thanks a lot..
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Originally posted by shri mon:
can we write a class that will not extend java.lang.Object?


no.


Groovy
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.lang.Object