class Animal { void eat() { System.out.println("eaƟng..."); } } class Dog extends Animal { void bark() { System.out.println("barking..."); } } Class BabyDog extends Dog { void weep() { System.out.println("weeping..."); } } public class LabTask16 { public staƟc void main(String args[]) { BabyDog d=new BabyDog(); d.weep(); d.bark(); d.eat(); } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter