Question: What is the result of the following code segment? String word = sunflower; String x = word. substring(3); String y = word.substring (3, 9);

What is the result of the following code segment? String word = "sunflower"; String x = word. substring(3); String y = word.substring (3, 9); if ( x == ==y) System.out.print(1); else if ( x.equals(y)) System.out.print(2); else System.out.print (3); 01 2 O 3 O 12 13
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
