public static void processtrans()throws FileNotFoundException{
Scanner input = new Scanner(transFile);
String line = input.nextLine();
double dollar = 0;
int transNum = 1;
while (input.hasNextLine()) {
int Space = line.indexOf (" ");
int Space2 = line.indexOf (" ", Space + 1);
String action = line.substring(0,Space);
if (action == "ORDER"){
int Space3 = line.indexOf (" ", Space2);
String isbn = line.substring(Space + 1, Space2);
int num = Integer.parseInt(line.substring(Space2 + 1, Space3));
int custNum = Integer.parseInt(line.substring(Space3 + 1));
System.out.println("Number= " + num);
System.out.println("Customer number= " + custNum);
}
line = input.nextLine();
}
}
While I was debugging this code since it compiles but doesn't print anything I saw that it reads the first line of input separates the first word and puts it in the String action but after that it sees if action is "ORDER" or not then skips everything to the line I don't understand why can someone help me?