This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

need help urgently

 
Sridhar Garimella
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Friends,
I have following doubts.
1) Why did java designers make Object class as super class to every class? Any specific reaons?
2) Why did java designers provide java.lang package by default? Any specific reasons?
Thanks for the help,
Sridhar Garimella.
 
inam paki
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi garimella
1) In my opinion Object class actually provides a mechanism to handle any kind of Object polymorphically.
Or in simple words You can say that it acts as the most common handle/reference an object can get
So you can deal different objects in same category.
2) java.lang package contains all the classes a user's class may need without importing any other package. This prevents any beginner to be confused in packages.
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) Because in an object oriented language "evereything" is supposed to be an "object". Of course primitives are an exception to this rule in Java, for efficiency reasons.
2) Sun provides LOTS of libraries that we can use. The java.lang package is just ONE of these provided in the jre. They did this because they are REALLY good at coding java , and they wanted some control over the way the basic functionality of the language grew and was implemented.
 
Jamie Robertson
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) A little explanation from Sun
Jamie
corrected URL tag
[ July 30, 2002: Message edited by: Frank Carver ]
 
Sridhar Garimella
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Friends,
I'm extremely sorry for posting same question in different forums. I won't repeat the same in future.
Thank you very much for your replies.
Regards
Sridhar
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic