How to make the program do nothing in a conditional

-1

My question may sound strange, but I am putting together an easy videogame in Java, I am working with eclipse the graphical interfaces, and there is a part in that I have the following: I have a JTable where in each row I have data stored in a character and a button to add, where the idea is that each time you select the character, the add button adds it to another Jtable, and I need this last table to have a maximum of 25 rows, and for that I put an if else, where if is the size if it is less than 25 that adds it, but in the other I do not know what to put so that if the size is equal to or greater than 25, do not do anything, because as a rule of the game, you should not exceed 25 characters. / p>     

asked by Christian 21.07.2018 в 18:15
source

1 answer

0

You can simply put

if(condicion){

}

The else is not mandatory, it is more handled as if it were another type of conditional because it is said, then you can have your if without the else, since your else does not do anything.

    
answered by 21.07.2018 в 18:41