aspose file tools*
The moose likes Beginning Java and the fly likes can we create a class named Object? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "can we create a class named Object?" Watch "can we create a class named Object?" New topic
Author

can we create a class named Object?

senthil sen
Ranch Hand

Joined: Oct 10, 2002
Posts: 184
can we create a class named Object??
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61788
    
  67

What happened when you tried it?
bear


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
rob javier
Greenhorn

Joined: Oct 20, 2002
Posts: 9
it compiles
Arun Boraiah
Ranch Hand

Joined: Nov 28, 2001
Posts: 233
Yes, you can create class by name Object. But to create the instance of the Object class written by user and use the same. The class should be refered with fully qualified name. i.e If a user writes Object class in a package test, Then refer the Ojbect class as test.Object
-arun


Sharing is learning
Sam Smoot
Ranch Hand

Joined: Apr 18, 2002
Posts: 238
That would be a bit confusing, try naming it somthing else... TestObject, for example...


CNSS/NSA Infosec Professional,<br />Software Engineer
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15300
    
    6

It's not that confusing. And I think it is a good idea to start using packages early on while learning JAVA.
However, Object is a little vague. I would imagine that your Class file encompusses something a little more defined and less general.
IMHO - Keep very descriptive names for your class files. It makes it easier to know what they do at a glance than to have to go into the code every time. Especially if you haven't looked at it in a while.


GenRocket - Experts at Building Test Data
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: can we create a class named Object?