Example error instanceof and getclass,
February 23, 2010 at 4:17 PM
I am sending the corrected code:
interface one{ }
class Two implements one { } class Three implements one { }
public class Testinstance { public static void main(String args[]) { Testinstance t1=new Testinstance(); one test1 = new Two(); one test2 = new Three(); System.out.println(test1 instanceof one); //true System.out.println(test2 instanceof one); //true System.out.println(t1.getClass().equals(test2.getClass())); //false } }