Loading topic
extends to connect the two.2 min readextends.1 min readDog extends Animal, Dog is a subtype of Animal. Every dog is also an animal, so Java lets you treat a dog as an animal. This chapter shows how that works and how Java picks which method to run.2 min readsuper lets you reach the 2 min readnew, Java sets it up in a fixed order. This order decides which code runs first. If you know it, you can avoid bugs where a field has an unexpected value.2 min readabstract and final.1 min readextends. Composition means a class holds an object of another class in one of its fields. The outer class then asks that inner object to do th2 min read