1
I wrote a code taken from a book but understood that it is the first method to be put, but as there was no example given, I tried to insert it several times in different points. As in this example I have private and public classes I want to know how to get it running:
import javax.swing.JOptionPane;
public class Pessoa {
private int idade;
private String nome;
public void setNome(String nome) {
this.nome = nome;
}
public void setIdade(int idade) {
this.idade = idade;
}
public int getIdade(){
return(this.idade);
}
public String getNome() {
return(this.nome);
}
public static void ShowInfo(int idade, String nome) {
JOptionPane.showMessageDialog(null,"Nome: "+nome +"\nIdade:"+idade, "\nOK", JOptionPane.INFORMATION_MESSAGE);
}
}
There is a data that I should tidy up, because it continues saying that it has no main method.
Right, but what the code would look like completely?
– Thiago Felipe Navarro