This question already has an answer here:
- Different object and reference 2 answers
For example, if you do the following instantiation:
Animal sparky = new Dog();
Is sparky then an object of Animal or an object of Dog?
And one other question: If you have an interface called Flys and you in class Animal instantiate that interface:
public Flys flyingType;
would "flyingType" be called a variable or an object?
Aucun commentaire:
Enregistrer un commentaire