Which of the following methods will create a string in Java?
I: String S = "Hello Java”;
II: String S2 = new String (“Hello Java");
1
Only I
2
Only II
3
Both I and II
4
Neither I nor II
5
Question Not Attempted
Which of the following methods will create a string in Java?
I: String S = "Hello Java”;
II: String S2 = new String (“Hello Java");