code implemented

This commit is contained in:
Aleksandar Dudukovic
2017-04-29 16:35:57 +02:00
parent a34e7be9c2
commit 8530d01e10
3 changed files with 24 additions and 0 deletions

View File

@ -2,5 +2,12 @@
* Created by Alexis on 28-Apr-17.
*/
public class App {
public static void main(String[] args) {
Guard guard = new Guard();
if (guard instanceof Permission) {
guard.enter();
}
}
}

View File

@ -0,0 +1,10 @@
/**
* Created by Alexis on 29-Apr-17.
*/
public class Guard implements Permission {
protected static void enter() {
System.out.println("You can enter");
}
}

View File

@ -0,0 +1,7 @@
/**
* Created by Alexis on 29-Apr-17.
* Interface without any methods
* Marker interface is based on that assumption
*/
public interface Permission {
}