I'm really confused why my program is not working. It'll compile and run, but no output will be printed to the console. I'm using the "Run Configurations" feature in the Eclipse IDE and placing my input into the "Program Arguments" section. My input is below. The first line indicates how many processes will have to run. My program is supposed to perform the basic action of printing out the relationship between number_1 and number_2
3
10 20
20 10
10 10
I'm using a Scanner object, but it doesn't seem to be taking in the input properly.
import java.util.Scanner;
public class Operator {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int runs = input.nextInt();
Integer num1;
Integer num2;
for(int i = runs; i > 0; i--){
num1 = input.nextInt();
num2 = input.nextInt();
switch(num1.compareTo(num2)){
case 1:
System.out.println(">");
break;
case 0:
System.out.println("=");
break;
case -1:
System.out.println("<");
break;
}
}
input.close();
}
}
System.innot command line arguments -try prompting for some inputSystem.out.println ("Enter num1"); num1 = input.nextInt();Scannerdoesn't read your command line arguments