[Resolvido] inicio em java
Hoje comecei a aprender classes vendo uma video aulas. ai fiz este codigo:
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package classes;
/**
*
* @author Ricardo
*/
public class CLASSES {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
PESSOA pessoa1 = new PESSOA();
pessoa1.nome = "Ricardo Henrique";
pessoa1.idade = 18;
pessoa1.sexo = 'M';
pessoa1.identidade = 1234567890;
System.err.println(pessoa1.nome+" "+pessoa1.idade+ " "+pessoa1.sexo+" "+pessoa1.identidade);
}
}
a classe e esta
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package classes;
/**
*
* @author Ricardo
*/
public class PESSOA {
String nome;
int idade;
char sexo;
int identidade;
}
e da o seguinte erro:
Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - cannot find symbol
symbol: variable M
location: class classes.CLASSES
at classes.CLASSES.main(CLASSES.java:21)
Java Result: 1
CONSTRUÍDO COM SUCESSO (tempo total: 0 segundos)
alguem pode me ajudar ?
Discussão (5)
Carregando comentários...