Which constructor is used to create empty string object?
Answers
Answered by
2
Answer: If you use the default string constructor, you get an instance of an empty string, but it is a new instance, as stated in JavaDoc: Initializes a newly created String object so that it represents an empty character sequence. Note that use of this constructor is unnecessary since Strings are immutable.
Similar questions