Professional Documents
Culture Documents
ArrayList;
import java.util.Scanner;
int option;
do {
System.out.println("Do you wanna register a new student? (Type 1 for
Yes and 2 for No)");
option = scanner.nextInt();
scanner.nextLine();
if (option == 2) {
for (Aluno aluno : alunos) {
System.out.println(aluno);
}
break;
}
@Override
public String toString(){
return "Students name: " + name + "\n" +
"Students age: " + age + "\n" +
"Students registration number: " + nregistration + "\n";
}
}