/** * Author: Josiah Yoder et al. * Class: SE1021-031 * Date: 12/11/13 11:47 AM * Lesson: Week 2, Day 2 */ package example2_2; /** * This is an example from after class. (Not part of the "official class") * * It illustrates a self-reference. */ public class Example { public static void main(String[] ignored) { // See the slides for the UML diagram. // // In this case, we have two instances, // and one instance (bob) has a reference // to the other (sandy) Student bob = new Student(); Student sandy = new Student(); bob.setBuddy(sandy); // If it were public, we might write: // bob.buddy = sandy; } }