+ 2
String vs. String Literal
What is the difference between a string and a string literal? Better yet, what makes a string NOT a string literal? Please provide examples.
1 Answer
+ 1
A String literal is a Java language concept. This is a String literal:
"a String literal"
A String object is an individual instance of the java.lang.String class.
String s1 = "abcde";