1. Engineering
  2. Computer Science
  3. what would be printed when the following code is executed...

Question: what would be printed when the following code is executed...

Question details
What would be printed when the following code is executed?     
if   ( “string1” != “string2”)    
System.out.println(“Strings are not equal”);
else    
System.out.println(“Strings are equal”);
a.
Strings are not equal
b.
Strings are equal
c.
Nothing is printed, as there is a syntax error.
d.
Nothing is printed, there is a runtime error.
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution