3
I am doing an exercise that is necessary to create a vector of 10 names, and that has 3 methods. The first method is called register,and has the function to fill the vectors, the second method is called draw which returns a String(which aims to draw names), and the third method called display which has the function of displaying the selected names. I’m having certain doubts about the 3 methods,.
Here is the code only with a scope same :
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, : Register Name,Draw Name and Display Name,each button calling a method.
OBS :I’m really sorry,if the code has practically nothing ready,I’m really having doubts in this part of the 3 methods,why I started now to learn about methods.
Already thank you for having the patience with this my post anything tidy.
Hello, @Falino. Welcome. It seems that your question is not about methods or classes but about algorithms. I suggest you ask one question at a time about the things you doubt.
– Pablo Almeida
Hello friend, yes indeed the doubt is about vector.In the course of Programming that I’m doing, we learn vector and matrix very little even, we focus more on this part of Class and Methods. It is a professional course anyway, but still it was little time to learn vector,and because of this I am with many doubts.
– Falion
So, @Falion. I suggest you ask a question for every question you have, so that your question fits the format of the Portuguese OS. For example: "How to draw an element from an array". This way you’ll even find that there are already solutions to your questions right here in the OS.
– Pablo Almeida