Your preferences have been saved!
» This program tests the Employee class - import java.util.Date; import java.util.GregorianCalendar; /**  * This program tests the Employee class.  *   * @version 1.11 2004-02-19  * @author Cay Horstmann  */ public class EmployeeTest {   public static void main(String[] args) {... 17 Feb 12 » This program demonstrates object construction - import java.util.Random; /**  * This program demonstrates object construction.  *   * @version 1.01 2004-02-19  * @author Cay Horstmann  */ public class ConstructorTest {   public static void main(String[] args) {     // fill the staff array with three Employee objects... 17 Feb 12 » A changeable wrapper class - import java.util.ArrayList; import java.util.List; class IntValue {   private int n;   public IntValue(int x) {     n = x;   }   public int getValue() {     return n;   }... 17 Feb 12 » Examination of the way the class loader works - class Candy {   static {     System.out.println("Loading Candy");   } } class Gum {   static {     System.out.println("Loading Gum");   } }... 17 Feb 12 » Objects that cannot be modified are immune to aliasing - public class Immutable1 {   private int data;   public Immutable1(int initVal) {     data = initVal;   }   public int read() {     return data;   }   public boolean nonzero() {     return data != 0;... 17 Feb 12 » A companion class to modify immutable objects - class Mutable {   private int data;   public Mutable(int initVal) {     data = initVal;   }   public Mutable add(int x) {     data += x;     return this;   }   public Mutable multiply(int x) {... 17 Feb 12 » Demonstrates Reference objects - // : c11:References.java // Demonstrates Reference objects // From 'Thinking in Java, 3rd ed.' (c) Bruce Eckel 2002 // www.BruceEckel.com. See copyright notice in CopyRight.txt. import java.lang.ref.PhantomReference; import java.lang.ref.Reference; import java.lang.ref.ReferenceQueue; import java.lang.ref.SoftReference; import java.lang.ref.WeakReference; class VeryBig {... 17 Feb 12 » Passing objects to methods may not be what you're used - class Letter {   char c; } public class PassObject {   static void f(Letter y) {     y.c = 'z';   }   public static void main(String[] args) {     Letter x = new Letter();     x.c = 'a';... 17 Feb 12 » Create Object Demo - public class CreateObjectDemo {   public static void main(String[] args) {     // create a point object and two rectangle objects     Point origin_one = new Point(23, 94);     Rectangle rect_one = new Rectangle(origin_one, 100, 200);     Rectangle rect_two = new Rectangle(50, 100);     // display rect_one's width, height, and area     System.out.println("Width of rect_one: " + rect_one.width);     System.out.println("Height of rect_one: " + rect_one.height);     System.out.println("Area of rect_one: " + rect_one.area());... 17 Feb 12