public class Pessoa {
    private String nome;
    private int idade;
    public Pessoa(String nome, int idade) {
        this.nome = nome;
        this.idade = idade;
    }
    public String getNome() {
        return nome;
    }
    public void setNome(String nome) {
        this.nome = nome;
    }
    public int getIdade() {
        return idade;
    }
    public void setIdade(int idade) {
        this.idade = idade;
    }
}
public class Aluno extends Pessoa {
    private int matricula;
    private String curso;
    public Aluno(String nome, int idade, int matricula, String curso) {
        super(nome, idade);
        this.matricula = matricula;
        this.curso = curso;
    }
    public int getMatricula() {
        return matricula;
    }
    public String getCurso() {
        return curso;
    }
    @Override
    public String toString() {
        return "aluno: " + this.getNome() +"-" + "Idade: " + getIdade() + " Cursando: " + getCurso() + " Matricula Ativa: " + getMatricula() ;
    }
}
import java.util.ArrayList;
public class Pricinpal {
    public static void main(String[] args) {
        Aluno aluno = new Aluno("João ", 17, 1, "java");
        Aluno aluno1 = new Aluno("Maria " ,16, 1, "CSS");
        Aluno aluno2 = new Aluno("Joaquin ", 18, 0, "Null");
        ArrayList<Aluno>listaDeAlunos = new ArrayList<>();
        listaDeAlunos.add(aluno);
        listaDeAlunos.add(aluno1);
        listaDeAlunos.add(aluno2);
        System.out.println("lista de todos os alunos cadastrados " + listaDeAlunos.size());
        System.out.println(listaDeAlunos);
    }
}