A list of top Java String FAQs (Frequently Asked Questions) or interview questions are given below. These questions can be asked by the interviewer.
String s1="javatpoint"; String s2="javatpoint";
Answer: Only one.
The equals() method matches content of the strings whereas == operator matches object or reference of the strings.
Answer: Yes.
Input:
this is javatpoint
Output:
tnioptavaj si siht
nitin
true
jatin
false
This Is Javatpoint
siht si tnioptavaj
tHIS iS jAVATPOINT
sIHT sI tNIOPTAVAJ