View Source

h3.Life Cycle of an Object Code Samples



Learn basic language constructs to start writing applications with the Java programming language.

* Creating Objects
* Garbage Collection
* Using Objects

h5.Creating Objects

* [Point.java|http://java.sun.com/docs/books/tutorial/java/data/examples/Point.java] shows how to pass data to a constructor to initialize an object. For supporting information see [The Java Tutorial: Object Basics and Simple Data Objects|http://java.sun.com/docs/books/tutorial/java/data/index.html].

* [Rectangle.java|http://java.sun.com/docs/books/tutorial/java/data/examples/Rectangle.java] shows how to use multiple constructors to initialize an object with different aspects of data. For supporting information see [The Java Tutorial: Object Basics and Simple Data Objects|http://java.sun.com/docs/books/tutorial/java/data/index.html].

h5.Garbage Collection



* [SocketThrdServer|http://java.sun.com/developer/onlineTraining/Programming/BasicJava2/Code/SocketThrdServer.java]. java shows how to use a finalize method to let a multithreaded socket program clean up and release resources before exiting. For supporting information see [Essentials of the Java Programming Language: Socket Communications|http://java.sun.com/developer/onlineTraining/Programming/BasicJava2/socket.html]


h5.Using Objects

* [CharacterDemo.java|http://java.sun.com/docs/books/tutorial/java/data/examples/CharacterDemo.java] creates a few character objects and displays some information about them. For supporting information see [The Java Tutorial: Object Basics and Simple Data Objects|http://java.sun.com/docs/books/tutorial/java/data/index.html].

----

The individuals who post here are part of the extended Sun Microsystems community and they might not be employed or in any way formally affiliated with Sun Microsystems. The opinions expressed here are their own, are not necessarily reviewed in advance by anyone but the individual authors, and neither Sun nor any other party necessarily agrees with them.

Copyright 1994-2009 Sun Microsystems, Inc.
Powered by Atlassian Confluence
Sun Guidelines on Public Discourse Privacy Policy Terms of Use Trademarks Site Map Employment Investor Relations Contact