KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > IfInstanceTest


1 public class IfInstanceTest {
2
3     public static void main (String JavaDoc [] args) {
4         IfInstanceTest ift = new IfInstanceTest();
5         ift.run(new Integer JavaDoc(9));
6     }
7
8     private void run(Object JavaDoc o) {
9         if (o instanceof String JavaDoc) {
10         }
11         else if (!(o instanceof Integer JavaDoc)){
12         }
13
14     }
15 }
16
Popular Tags