StringObjectsAsParameters

- /Line 4 public static void stringParameter(String pStr System.out.println"Line 5 In the method""stringParameter"/Line 5

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

This note was uploaded on 06/17/2011 for the course COMP 2301 taught by Professor Staff during the Spring '10 term at Kennesaw.

Ask a homework question - tutors are online