Question: are there any errors in this code: import java.util.Scanner; public class Main5 { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String
are there any errors in this code: import java.util.Scanner; public class Main5 { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String word2 = scanner.next(); String word3 = scanner.next(); String word4 = scanner.next(); String word5 = scanner.next(); String temp; if(word1.compareTo(word2) > 0) {temp = word1; word1 =word2; word2 = temp;} if(word1.compareTo(word3) > 0) {temp = word1; word1 =word3; word3 = temp;} if(word1.compareTo(word4) > 0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
