What will the following program print when run?.
public class Main { public static void main (String[] args) { StringBuilder sb1 = new StringBuilder("WOW"); StringBuilder sb2 = new StringBuilder(sb1); System.out.println((sb1==sb2) + " " + sb1.equals(sb2)); } }
Select the one correct answer.
(b)
The references sb1 and sb2 are not aliases.
The StringBuilder class does not override the equals()
method, hence the answer is (b).