String Literal - Java Quiz Question


Which of the following initialization is correct?


A
String str = 'Hai hello how are you';
B
String str;
str = "Hai hello how are you";
C
String str = Hai hello how are you;
D
String str;
str = 'Hai hello how are you';