This Test will cover String Handling from basic to advanced level. All the functions of String Class and StringBuffer and StringBuilder too.
Q. What is an immutable object?
A. an object whose state can be changed after it is created.
B. an object whose state cannot be changed after it is created.
C. an object which cannot be casted to another type.
D. an object which cannot be cloned.
Q. Which of the following is not a valid way to create String object?
Q. String objects are stored in a special memory area known as?
Q. What will be the result of given code?
Q. How many new objects are created in given code?
Q. Which method is used to convert a primitive type into String?
Q. Which method is used to remove leading and trailing whitespace(s)?
Q. What will be the output of following code?
Q. What will happen if you try to run the following code?
A. It will not print anything. B. It will print "srenraeL avaJ"
Q. Which class is used to create mutable and non-synchronised string?