public class Driver { public static void main(String [] args) { SecurityExample se = new SecurityExample(); String s; StringBuffer sb; System.out.println("Originals"); System.out.println("\t" + se.getS()); System.out.println("\t" + se.getSB()); s = se.getS(); // Reference to String attribute sb = se.getSB(); // Reference to StringBuffer attribute // Try to modify the attributes sb.delete(0,sb.length()); // Deletes mutable attribute sb.append("lolz! mucked ur data :P"); // New attribute value s = "lolz! mucked ur data :P"; // Only local changed System.out.println(); System.out.println("After modfications"); System.out.println("\tValues of locals"); System.out.println("\t\tString=" + s); System.out.println("\t\tStringBuffer=" + sb); System.out.println("\tValues of attributes"); System.out.println("\t\tString=" + se.getS()); System.out.println("\t\tStringBuffer=" + se.getSB()); } }