Skip to content

Instantly share code, notes, and snippets.

@minte9
Last active August 31, 2021 12:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save minte9/e9b73252ec64711bd43f5f110282057c to your computer and use it in GitHub Desktop.
Save minte9/e9b73252ec64711bd43f5f110282057c to your computer and use it in GitHub Desktop.
/**
* Define Dog class which
* Dog class must implement the correct class
*/
class App {
public static void main(String[] args) {
Dog d = new Dog();
d.bark(); // The dog is barking
}
}
interface Canine {
public abstract void bark();
}
interface Feline {
public abstract void roar();
}
/**
* SOLUTION
*/
class Dog implements Canine {
@Override
public void bark() {
System.out.println("The dog is barking");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment