Fri Jan 30, 2009 1:06 am
public class Main {
public static void main(String[] args) {
A classA=new A();
B classB=new B();
if(classA instanceof A)
{
System.out.println("Correct");
}
else
System.out.println("Wrong ");
if(classA instanceof Base)
{
System.out.println("Correct");
}
else
System.out.println("Wrong ");
if(classB instanceof A)
{
System.out.println("Correct");
}
else
System.out.println("Wrong ");
if(classB instanceof Base)
{
System.out.println("Correct");
}
else
System.out.println("Wrong ");
}
}
interface Base
{
}
class A implements Base
{
public A()
{
}
}
class B extends A
{
public B()
{
}
}
Wed Jun 12, 2013 12:02 am
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.