package de.codegym.task.task02.task0209;
/*
Max, Bella und Jack
*/
public class Solution {
public static void main(String[] args) {
Hund Jack = new Hund();
Hund Max = new Hund();
Hund Bella = new Hund();
}
public static class Hund {
public String name;
}
}
hilfe
Gelöst
Kommentare (1)
- Beliebt
- Neu
- Alt
Du musst angemeldet sein, um einen Kommentar schreiben zu können
Agent Smith
12 August 2020, 09:54
You have to set instance variable "name" for each object, instead of just naming reference variables.
One more thing to remember: variable names are lower case, class names are upper case.
It won't cause a compiler error, but it is considered a good practice. +2