Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-17-2007, 03:37 PM
Member
 
Join Date: Jul 2007
Posts: 4
venkatv is on a distinguished road
Creating object of Type Object class
Hi all

Can anybody tell me the usage of the reference object give below in a snnipet

Object obj = new Object();

My question is
what is the usage of object created of Type Object class?



Regards
venkat
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-17-2007, 03:54 PM
Member
 
Join Date: Jul 2007
Posts: 33
cecily is on a distinguished road
The standard class Object is a superclass of all other classes.

-A variable of type Object can hold a reference to any object, whether it is an instance of a class or an array.
-All class and array types inherit the methods of class Object.
-The methods of Object are as follows:
o The method getClass returns the Class object that represents the class of the object. A Class object exists for each reference type. It can be used, for example, to discover the fully qualified name of a class, its members, its immediate superclass, and any interfaces that it implements.
o The method toString returns a String representation of the object.
o The methods equals and hashCode are declared for the benefit of hashtables such as java.util.Hashtable. The method equals defines a notion of object equality, which is bosed on value, not reference, comparison.
o The method clone is used to make a duplicate of an object.
o The methods wait, notify and notifyAll are used in concurrent programming using threads.
o The method finalize is run just before an object is destroyed.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 07-17-2007, 04:00 PM
Member
 
Join Date: Jul 2007
Posts: 4
venkatv is on a distinguished road
Thx for ur view
My question is with the obj reference what is the use?
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 07-17-2007, 04:33 PM
Member
 
Join Date: Jul 2007
Posts: 33
cecily is on a distinguished road
it's a generic object class
and the use depends on what do you want to do.
for example

Code:
Object[][] data = new Object[6][2]
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a Comparable object Java Tip java.lang 0 04-15-2008 08:38 PM
List views, a type of object Leprechaun New To Java 2 02-06-2008 04:07 AM
Need help with creating array of type object riz618 New To Java 3 01-29-2008 07:14 AM
Getting object type gapper New To Java 1 01-20-2008 09:49 AM
How to cast an Object into a specific type (Integer/String) at runtime mailtogagan@gmail.com Advanced Java 2 12-03-2007 02:04 PM


All times are GMT +3. The time now is 08:24 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org