I'm trying to create a banking system. Using ArrayList and class systems, he made it possible for several people to open their accounts The error keeps coming up at the part where I check the card number. I don't think it's the right way. I didn't know what it was. I'd appreciate it if you let me know.
As I captured below, the error is notifications.
This is the code to check if the card number I wrote is saved in the system.
//loop is a while statement.
loop :while(true) {
//If the 'number' of the ArrayList object does not have a value...
The part between //** indicates the error.
** ** if((list.get(i).number) == null) **{
If there are no more objects stored in //list...
if(list.size()) < i){
Run a method (function) to output the error message //not working and leave the loop.
notworking();
break loop;
} //If you have the number of objects stored in the list...
else{
Add 1 to //i and continue looping.
i++;
continue loop;
}
}//If the 'number' of the ArrayList object has a value...
else {
// output a method (function) that outputs related information and exits the loop.
Showinfo(scan, i);
break loop;
}
If you look at the error message carefully, the operator == is undefined for... There's a message called "long."
class CodeRunner{
public static void main(String[] args){
if(1==null){
System.out.println("Hello Java");
}
}
}
It looks like the same error as you executed this code. Long and null are not comparable.
© 2024 OneMinuteCode. All rights reserved.