I am new in java and have a problem writing my code. The problm is, im taking 10 strings from user and wants to print the largest one out all 10 strings.The Input Section works well, But there is an IDE error: "of bad operands for binary '>' operator" while using if condition . The code is below..
import java.util.Scanner;
import java.io.InputStream;
public class Largest_String {
public static void main(String[] args) {
Scanner input=new Scanner(System.in);
System.out.println("Please Enter The 10 Strings: ");
for(int i=1; i<=10; i++){
System.out.print(i+") ");
String str=input.nextLine();
String array[]=new String[10];
for(int j=10; j>0; j++){
if(array[i]>array[j]){
System.out.println("The Largest String if"+ array[i]);
}
}
}
}
}