Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2014
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. public class main {
  2. public static void main(String[] a) {
  3. String s = "hello";
  4. System.out.println("s is: " + s);
  5. s = duplicateString(s);
  6. System.out.println("s is: " + s);
  7. updateString(s);
  8. System.out.println("s is: " + s);
  9. }
  10.  
  11. public static String duplicateString(String z) {
  12. String result = z + z;
  13. return result;
  14. }
  15.  
  16. public static void updateString(String str) {
  17. str = "updated!";
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement