📘 Premium Read: Access my best content on Medium member-only articles — deep dives into Java, Spring Boot, Microservices, backend architecture, interview preparation, career advice, and industry-standard best practices.
✅ Some premium posts are free to read — no account needed. Follow me on Medium to stay updated and support my writing.
🎓 Top 10 Udemy Courses (Huge Discount): Explore My Udemy Courses — Learn through real-time, project-based development.
▶️ Subscribe to My YouTube Channel (172K+ subscribers): Java Guides on YouTube
Check out all the Java daily quiz questions at https://www.javaguides.net/p/java-daily-quiz.html
Java Daily, Quiz 2 - Consider the following program:
public class StrEqual {
public static void main(String[] args) {
String s1 = "hello";
String s2 = new String("hello");
String s3 = "hello";
if (s1 == s2) {
System.out.println("s1 and s2 equal");
} else {
System.out.println("s1 and s2 not equal");
}
if (s1 == s3) {
System.out.println("s1 and s3 equal");
} else {
System.out.println("s1 and s3 not equal");
}
}
}
b) s1 and s2 equal
c) s1 and s2 not equal
d) s1 and s2 not equal
s1 and s2 equal
s1 and s3 equal
s1 and s2 equal
s1 and s3 not equal
s1 and s2 not equal
s1 and s3 equal
s1 and s2 not equal
s1 and s3 not equal
Answer
s1 and s2 not equal
s1 and s3 equal
Check out all the Java daily quiz questions at https://www.javaguides.net/p/java-daily-quiz.html.
Comments
Post a Comment
Leave Comment