Question 50 of 76 from exam 1Z0-808: Java SE 8 Programmer I

Question 50 of 76 from exam 1Z0-808: Java SE 8 Programmer I

Question

Given the code fragment:

public class App {
public static void main(string[] args) {

String strl = "Java";
String str2 = new string("java");
ffline nl

{
System. out. println ("Equal");
} else {
System. out.println ("Not Equal");

Which code fragment, when inserted at line n1, enables the App class to print Equal?

© A) string str3 = str2;
if (gtr1 == str3)

CB) if (strl.equalsIgnoreCase (str2) )

© C) string str3 = str2;
if (str1.equals(str3))

CD) if (str1.toLowerCase () str2.toLowerCase ())

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

B.