Skip to content

Instantly share code, notes, and snippets.

@mateusmiguel
Created September 25, 2019 03:09
Show Gist options
  • Save mateusmiguel/fd86cbd29e85dc4890ef6d51ad295ff6 to your computer and use it in GitHub Desktop.
Save mateusmiguel/fd86cbd29e85dc4890ef6d51ad295ff6 to your computer and use it in GitHub Desktop.
import java.util.Arrays;
public class CadastroAlunos {
public static void main(String args[]) {
String[] Alunos = new String[25];
for (int i = 0; i < 25; i++) {
Alunos[i] = "Aluno " + (i + 1);
}
String[] MaisAlunos = Arrays.copyOf(Alunos, 30);
for (int i = 25; i < 30; i++) {
MaisAlunos[i] = "Aluno adicional " + (i + 1);
}
System.out.println(Arrays.toString(MaisAlunos));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment