Java From Beginner To Advanced

0% completed

Previous
Next
Quiz
What will be the output of the following Java code?
String s1 = "Java";
String s2 = "Java";
System.out.println(s1 == s2);
A
true
B
false
C
Compilation Error
D
Runtime Error
Question 2
Which class is used to create mutable strings in Java?
Choose all correct options
String
StringBuffer
StringBuilder
Both b and c
Question 3
Which of the following methods can be used to compare two String objects for content equality in Java?
A
==
B
compareTo()
C
equals
D
hashCode()

.....

.....

.....

Like the course? Get enrolled and start learning!
Previous
Next