According to java 7 it is mentioned that we can create derived class instance using base class.
but
 its not working i am trying to implement this concept
 so that i am mention my code over here...
please provide me the solution and solve the problem....
this is the error 

```
class A
{
     public void show()
     {
          System.out.println("A class");
     }
}
class B extends A
{
    public void display()
    {
          System.out.println("B class");
    }
}
class Demo
{
     public static void main(String args[])
     {
          B obj=new B();
          obj.display();
     }
}

```