Hello, the activity proposal would show how many years the user would have, I wrote my code first so I could compare it with the teacher, it turns out that my first line was much smaller than the teacher.
This is my code:
int an = (int) txtAN.getValue(); // an (ano de nascimento), pega o valor de um spinner
int ran = 2017 - an; // ran (resultado do ano de nascimento)
lblIdade.setText(Integer.toString(ran)); // mostra no label o valor recebido
This is the teacher's:
int an = Integer.parseInt(txtAN.getValue().toString());
int id = 2017 - an;
lblIdade.setText(Inteer.toString(id));
typecast
(as in my
case), or use wrapper class
(as in the case of the teacher)? Note: This is a project using Swing.