{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

StringObjectsAsParameters

StringObjectsAsParameters - /Line 4 public static void...

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

View Full Document Right Arrow Icon
//Program: String Objects as Parameters / public class StringObjectsAsParameters { public static void main(String[] args) { String str = "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: " + str);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: //Line 4 } public static void stringParameter(String 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 = "Sunny Day"; //Line 7 System.out.println("Line 8: pStr after changing " + "its value: " + pStr); //Line 8 } }...
View Full Document

{[ snackBarMessage ]}