1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

Object class problem

Discussion in 'Java' started by shyam_oec, Feb 24, 2008.

  1. shyam_oec

    shyam_oec New Member

    Code:
    class InstanceTest
    {
      public static void main(String [] args)
      {
       InstanceTest ob1=new InstanceTest();
       Object ob2=ob1;
       System.out.println(ob2 instanceof Object);
       System.out.println(ob2 instanceof InstanceTest);
      }
    }
    I am using jdk1.6
    I read this question on a site which tells it's output to be
    true
    true

    But when i tried it on my computer it generated error!!!
    can u tell why it happend so,and how to solve it.
     
    Last edited by a moderator: Feb 25, 2008

Share This Page