Question: What will the following program print when run? Select the one correct answer. (a) The program will print false true. (b) The program will print
What will the following program print when run?
![public class MoreCharSeq { public static void main (String[] args) { String](https://dsd5zvtm8ll6.cloudfront.net/images/question_images/1706/9/4/9/29065bdfaaacb2cc1706949290058.jpg)
Select the one correct answer.
(a) The program will print false true.
(b) The program will print false false.
(c) The program will print true false.
(d) The program will print true true.
(e) The program will fail to compile.
(f) The program will compile, but throw an exception at runtime.
public class MoreCharSeq { public static void main (String[] args) { String s1 = "WOW"; StringBuilder s2= new StringBuilder (sl); String s3= new String (s2); System.out.println ((s1.hashCode () ==$2.hashCode ())+""+ (s1.hashCode () ==$3.hashCode ()));
Step by Step Solution
3.45 Rating (155 Votes )
There are 3 Steps involved in it
a The StringBuilder class does not override the hashCode method but the String class d... View full answer
Get step-by-step solutions from verified subject matter experts
