0
I have a class with 'int = dia, mes e ano
' and on the other I’m calling them. Only that caught my attention was that when I put the value '08' says
'The literal 08 of type int is out of range'.
but when I put 07, compile smoothly.
I’ll enter the codes:
public class Data {
int dia;
int mes;
int ano;
}
public class DataTeste {
public static void main(String[] args) {
Data nascimento = new Data();
**nascimento.dia = 08;**--este valor da erro, mas 07 p/baixo valida.
nascimento.mes = 03;
nascimento.ano = 1989;
}
}
First, why create a class for date if java has so many classes for that?
– user28595
It’s just that I’m following an example from a video lesson...
– Maurício Maciel