Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String s1 = "java";
- String s2 = new String("java");
- class Ideone
- {
- public static void main (String[] args) throws java.lang.Exception
- {
- String s1 = new String("java");
- System.out.println(s1.toUpperCase());
- String s2 = "java";
- System.out.println(s2.toUpperCase());
- }
- }
- String s1="java" // will store in string pool
- String s2=new String("java"); //will store in heap
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement