| Author |
can we create a class named Object?
|
senthil sen
Ranch Hand
Joined: Oct 10, 2002
Posts: 182
|
|
|
can we create a class named Object??
|
 |
Bear Bibeault
Author and opinionated walrus
Marshal
Joined: Jan 10, 2002
Posts: 50691
|
|
What happened when you tried it? bear
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About 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: 237
|
|
|
That would be a bit confusing, try naming it somthing else... TestObject, for example...
|
CNSS/NSA Infosec Professional,<br />Software Engineer
|
 |
Gregg Bolinger
Sheriff
Joined: Jul 11, 2001
Posts: 15040
|
|
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.
|
My Blog | DZone Articles
|
 |
 |
|
|
subject: can we create a class named Object?
|
|
|