class ObjX { int i; // A variable of the same type: ObjX anotherX; } public class DynamicExample10 { public static void main (String[] argv) { // Make an ObjX instance. ObjX x = new ObjX (); x.i = 5; // Make the anotherX variable point to a new ObjX instance. x.anotherX = new ObjX (); x.anotherX.i = 6; } }