There are 3 syntax andor logic errors in the code below iden

There are 3 syntax and/or logic errors in the code below. identify them and suggest how they might be corrected. Line numbers are there for your reference.//check to see if three hard-coded strings are in//alphabetical (lexicographical) order public class questions public static main (String {} args) String s1 = \"apples\"; String s2 = \"coconuts\"; String s3 = \"bananas\"; if(s1.equals(s2) && s2.equals(s3)) System.out.printin(\"Strings are equal!\"); System.out.println(\"Your strings are in order (ascending) !\");} else (s1.compareTo(s2) >= 0 && s2.comopareTo(s3)

Solution

1)There is no semicolon at the end of line 19.

2)In line 4, void is missing. Change it to public static void main(String[] args) {

3) In line 15, change else to else if.

 There are 3 syntax and/or logic errors in the code below. identify them and suggest how they might be corrected. Line numbers are there for your reference.//ch

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site