• 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

Object references

 
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
* Object
* Cloneable
* Serializable

My understanding is the above three are object references.

Could someone give me an example of what these are/do/mean?
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
An "object reference" is basically a "handle" on a particular instance of some class. It is essentially a memory address, indicating where exactly that object is stored.

As for Object, Cloneable, and Serializable...

Object (class):
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html

Cloneable (interface):
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Cloneable.html

Serializable (interface):
http://java.sun.com/j2se/1.5.0/docs/api/java/io/Serializable.html
 
Maureen Charlton
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Marc,

Excellent reply - especially the links!

Many thanks!!
 
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The links given above come from Sun's Java API documentation. Learning how to navigate these is an essential skill for any Java programmer, imo. I strongly encourage you to use the link given here to find the docs for the version of Java that you are using.

Layne
 
Everybody's invited. Except this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic