Limited access

Upgrade to access all content for this subject

Consider the following console output.

\\"cat"//
\\"dog"//

Which of the following code segments produces the same output?

A

System.out.print("\\\"cat\"////\n\\\"dog\"////");

B

String d = "dog";
System.out.print("\\\\\"cat\"//\n\\\\\""+d+"\"//");

C

System.out.println("\\\"cat\"////");
System.out.println("\\\"dog\"////");

D

System.out.println("\\"cat"//");
System.out.println("\\"dog"//");

E

String c = "cat";
String d = "dog";
System.out.println("\\\""+c+"\"////");
System.out.println("\\\""+d+"\"////");

Select an assignment template