The exercise is of an extreme simplicity, but I want to put a bit of difficulty and do it with POO. I have to ask for 5 numbers and then do an operation with those numbers, there is a condition that the numbers can not be greater than 10. Now, in the class where I declare the numbers I put them value1, value2, value3, value4, value5, the question is that if I want to create a for to ask me the numbers one behind the other, practice a = new practice (); a.setValue1 (read.nextInt ());
How could I do to verify the condition as the numbers are entered, without having to set setValor2, setValor3, etc, since the for would be to simplify the code .. As I said before, it can be done the exercise in a much simpler way, declaring only variables in the same main class, but I am practicing OOP. I await your comments.