Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Lerngruppe {
- Student student1;
- Student student2;
- void sagStudenten() {
- System.out.println("Hier lernen");
- student1.sagName();
- System.out.println("und");
- student2.sagName();
- }
- void drucke() {
- student1.drucke();
- System.out.println();
- student2.drucke();
- }
- public static void main(String [] args) {
- Lerngruppe l1 = new Lerngruppe();
- Student a = new Student();
- a.name = "Anton Baier";
- a.matrikel = 123456;
- a.mentor = "Bodo Igler";
- Student b = new Student();
- b.name = "Berta Meier";
- b.matrikel = 999999;
- b.mentor = "Bodo Igler";
- l1.student1 = a;
- l1.student2 = b;
- System.out.println("\n// Lerngruppe //\n");
- l1.drucke();
- //l1.sagStudenten();
- }
- }
Add Comment
Please, Sign In to add comment