Write a program in java to demonstrate instanceof operator?

class InstanceOf

{

                public static void main(String arg[])

                {

                                InstanceOf x=new InstanceOf();

                                System.out.println(x instanceof InstanceOf);

                                InstanceOf y=null;

                                System.out.println(y instanceof InstanceOf);

                }

}

InstanceOf Operator

, , , , , , , ,

Leave a Reply