CJCoding With Joseph
15free / daySign inCreate account
Back to Multiple Choice Quiz

Select topics to narrow your question pool, then enable Random to jump to a random question matching your filters.

Topics

String Comparison

Java quiz · Question 4
mediumStrings

What is the output of this code?

Code

1public class Main {
2 public static void main(String[] args) {
3 String a = new String("hello");
4 String b = new String("hello");
5 System.out.println(a == b);
6 System.out.println(a.equals(b));
7 }
8}