Run ❯
Get your
own Java
server
❯
Run Code
Ctrl+Alt+R
Change Orientation
Ctrl+Alt+O
Change Theme
Ctrl+Alt+D
Go to Spaces
Ctrl+Alt+P
class Animal { public void animalSound() { System.out.println("The animal makes a sound"); } } class Dog extends Animal { public void animalSound() { super.animalSound(); // Call the parent method System.out.println("The dog says: bow wow"); } } public class Main { public static void main(String[] args) { Dog myDog = new Dog(); myDog.animalSound(); } }
The animal makes a sound
The dog says: bow wow