| Author |
how every java program extends Object class by default
|
S.Reddisekhar Reddy
Greenhorn
Joined: Jan 05, 2012
Posts: 10
|
|
|
how every java program extends Object class by default
|
 |
Jeff Verdegan
Bartender
Joined: Jan 03, 2004
Posts: 3143
|
|
Because the JLS is written that way and compilers are written to implement the JLS.
|
 |
fred rosenberger
lowercase baba
Bartender
Joined: Oct 02, 2003
Posts: 8428
|
|
I am going to hire you as a painter. There is a clause in the contract that says "If I don't tell you what color to paint a room, paint it beige".
I then say "Go paint my bedroom red, my kitchen green. Also paint the playroom and bathroom."
You know that even though I don't explicitly say what color to paint the last two rooms, you should paint it beige.
The compiler knows that if you don't explicitly state "extends <whatever>", the class should extend the Object class.
|
Never ascribe to malice that which can be adequately explained by stupidity.
|
 |
 |
|
|
subject: how every java program extends Object class by default
|
|
|