Created
December 3, 2020 02:12
-
-
Save Harsimran1/6b747d94d4a8b3e49528261029df755d to your computer and use it in GitHub Desktop.
Java Interface Definition Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Vehicle | |
{ | |
// public and abstract | |
void drive(); | |
} | |
// A class that implements the interface. | |
class Car implements Vehicle | |
{ | |
// Implementing the capabilities of | |
// interface. | |
public void drive() | |
{ | |
System.out.println("Drive"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment