/* Method6.java CIS 160 Dave Klick 2004-10-18 passing Strings [doesn't work like most reference variables] */ public class Method6 { public static void main(String[] args) { String s = "Dave"; System.out.println("Before calling changeString(): " + s); changeString(s); System.out.println("After calling changeString(): " + s); } private static void changeString(String str) { System.out.println("Start of changeString(): " + str); str = "Klick"; System.out.println("End of changeString(): " + str); } } /* Output: Before calling changeString(): Dave Start of changeString(): Dave End of changeString(): Klick After calling changeString(): Dave */