• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

need help urgently

 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic