Vidyalelo
Java Programming · Q2

Strings

Programming · Java Programming · question 2

Q2

What is the correct way to create a new empty String object in Java?

A.
String emptyString = "";
B.
String emptyString = new String();
C.
String emptyString = " ";
D.
String emptyString = null;
E.
Both A and B
Answer

Answer: Option E

Solution

Answer: Option E
No explanation is given for this question Let's Discuss on Board