Page 1 of 1

Which are the correct options please?

Posted: Fri Jun 10, 2022 11:57 am
by correctanswer
Which are the correct options please?
Which Are The Correct Options Please 1
Which Are The Correct Options Please 1 (149.18 KiB) Viewed 94 times
String frog1= "FROG"; String frog2= "Frog".toUpperCase(); String frog3= frog1; String frog = "frog"; System.out.println(frog1 == frog2); // line 1 System.out.println(frog == frog1); // line 2 System.out.println(frog.equals(frog1)); // line 3 System.out.println(frog1.equals(frog2)); // line 4 // line 5 System.out.println(frog1 == frog3); Select one or more: The result of executing line 1 is true because frog1 and frog2 both reference strings consisting of the four characters F, R, 0 and G. The result of executing line 2 is true because frog and frog1 both reference the same string consisting of the four characters F, R, 0 and G. The result of executing line 3 is true because frog and frog1 both reference the same string consisting of the four characters F, R, 0 and G. The result of executing line 4 is true because frog1 and frog2 both reference strings consisting of the four characters F, R, 0 and G. The result of executing line 5 is true because frog1 and frog3 both reference the same String object consisting of the four characters F, R, 0 and G.