StringBufferObjectsAsParameters

StringBufferObjectsAsParameters - + str); //Line 4 } public...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
//Program: StringBuffer Objects as Parameters / public class StringBufferObjectsAsParameters { public static void main(String[] args) { StringBuffer str = new StringBuffer("Hello"); //Line 1 System.out.println("Line 2: str before calling " + "the method stringParameter: " + str); //Line 2 stringParameter(str); //Line 3 System.out.println("Line 4: str after calling " + "the method stringParameter: "
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: + str); //Line 4 } public static void stringParameter(StringBuffer pStr) { System.out.println("Line 5: In the method " + "stringParameter"); //Line 5 System.out.println("Line 6: pStr before changing " + "its value: " + pStr); //Line 6 pStr.append(" There"); //Line 7 System.out.println("Line 8: pStr after changing " + "its value: " + pStr); //Line 8 } }...
View Full Document

Ask a homework question - tutors are online