Skip to content

Commit 617cc8e

Browse files
authored
Create InstanceOfTest.java
1 parent 0a38cf5 commit 617cc8e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

InstanceOfTest.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Java program to demonstrate working of
2+
// instanceof operator
3+
4+
public class InstanceOfTest
5+
{
6+
public static void main(String[] args)
7+
{
8+
Integer i = new Integer(5);
9+
10+
// prints true as i is instance of class
11+
// Integer
12+
System.out.println(i instanceof Integer);
13+
}
14+
}

0 commit comments

Comments
 (0)