fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10.  
  11. private String name = "Minh Vu";
  12.  
  13. public String getString() {
  14. return name;
  15. }
  16.  
  17. public void setString(final String s) {
  18. name = s;
  19. }
  20.  
  21. public static void main (String[] args) throws java.lang.Exception
  22. {
  23. // your code goes here
  24. Ideone i = new Ideone();
  25. i.setString("Nguyen Chiem Minh Vu");
  26. System.out.println(i.getString());
  27. String s = "asdfas";
  28. changeString(s);
  29. System.out.println(s);
  30. }
  31.  
  32. public static void changeString(String s) {
  33. s = "nguyen chiem minh vu";
  34. }
  35. }
Success #stdin #stdout 0.12s 320576KB
stdin
Standard input is empty
stdout
Nguyen Chiem Minh Vu
asdfas