The files provided in the code editor to the right contain syntax and/or logic errors. In each case, determine and fix the problem, remove all syntax and coding errors, and run the program to ensure it works properly // Makes String comparisons public class DebugSeven1 { public static void main(String[] args) { String name1 = "Roger"; String name2 = "Roger"; String name3 = "Stacy"; if(name1.equals(name2)) System.out.println(name1 + " and " + name2 + " are the same");
The files provided in the code editor to the right contain syntax and/or logic errors. In each case, determine and fix the problem, remove all syntax and coding errors, and run the
// Makes String comparisons
public class DebugSeven1
{
public static void main(String[] args)
{
String name1 = "Roger";
String name2 = "Roger";
String name3 = "Stacy";
if(name1.equals(name2))
System.out.println(name1 + " and " + name2 +
" are the same");
if(name1.equals(name3))
System.out.println(name1 + " and " + name2 +
" are the same");
if(name1.equals("roger));
System.out.println(name1 + " and 'roger' are the same");
if(name1.equals("Roger"));
System.out.println(name1 + " and 'Roger' are the same");
}
}
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images