Skip to content
CodeKruPro

== versus equals() on strings

QuizEasyJava onlyAsked in: Capgemini, Infosys

What does this print?

String a = "test";
String b = "test";
String c = new String("test");
System.out.println((a == b) + " " + (a == c) + " " + a.equals(c));
Choose one answer.

to answer and keep your progress. Reading is free for everyone.