Advertisement
Guest User

Untitled

a guest
Apr 20th, 2014
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. String s1 = "java";
  2.  
  3. String s2 = new String("java");
  4.  
  5. class Ideone
  6. {
  7. public static void main (String[] args) throws java.lang.Exception
  8. {
  9. String s1 = new String("java");
  10. System.out.println(s1.toUpperCase());
  11.  
  12. String s2 = "java";
  13. System.out.println(s2.toUpperCase());
  14. }
  15. }
  16.  
  17. String s1="java" // will store in string pool
  18. String s2=new String("java"); //will store in heap
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement