• 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
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

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
 
please buy this thing and then I get a fat cut of the action:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic