I'm doing an exercise that you need to create a vector of 10 names, and you have 3 methods. The first method is called registerName , and has the function to fill in the vectors, the second method is called sortName that returns a String (which is meant to draw names), and the third method called displayName , whose function is to display the names that have been drawn. I have some doubts about the 3 methods, if you can help me I will thank you, I will put below parts of the code, at least the structure of it.
Here is the code with only one scope:
package Testes;
public class ClasseSorteio {
public static void main(String[] args) {
String nomeSorteado[] = new String[10];
}
public void cadastrarNome() {
for(int i = 0; i < 10; i++) {
}
}
public String sortearNome(String nome) {
for(int i = 0; i < 10; i++) {
}
return nome;
}
public void exibirNome() {
}
}
In the main class I will have to use JOptionPane, and I will have to have 3 buttons: Name, Sorte Name and Show Name , each button calling a method.
I'm really sorry, if the code does not have anything at all ready, I'm really in doubt about this part of the 3 methods, so I started learning about methods now.
Thanks for the patience with this my post is not tidy.