Skip to content

Instantly share code, notes, and snippets.

@evrentan
Created September 19, 2021 00:11
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 evrentan/94087e3e163ba81364a3ccc2fd9c9c9b to your computer and use it in GitHub Desktop.
Save evrentan/94087e3e163ba81364a3ccc2fd9c9c9b to your computer and use it in GitHub Desktop.
Java Interface Example
interface Animal {;
public void eat();
}
// Dog Class implements the Animal interface
class Dog implements Animal {
//eat moehod body is declared here
public void eat() {
System.out.println("Dogs eat meat");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment