We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a34e7be commit 8530d01Copy full SHA for 8530d01
marker/src/main/java/App.java
@@ -2,5 +2,12 @@
2
* Created by Alexis on 28-Apr-17.
3
*/
4
public class App {
5
+ public static void main(String[] args) {
6
+ Guard guard = new Guard();
7
8
+ if (guard instanceof Permission) {
9
+ guard.enter();
10
+ }
11
12
}
13
+
marker/src/main/java/Guard.java
@@ -0,0 +1,10 @@
1
+/**
+ * Created by Alexis on 29-Apr-17.
+ */
+public class Guard implements Permission {
+ protected static void enter() {
+ System.out.println("You can enter");
+}
marker/src/main/java/Permission.java
@@ -0,0 +1,7 @@
+ * Interface without any methods
+ * Marker interface is based on that assumption
+public interface Permission {
0 commit comments