Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  G
Language: JAVA
Code:
class Animal {

          String name="animal";
 void animal()
{
     System.out.println("this is animal constructor");
}
}
class Cat extends Animal  {
          String name="Cat";
          void Cat()
          {
               System.out.println("this is animal constructor");     
          }

     public static void main(String[] args) {
          Animal c=new Cat();
          System.out.println(c.name);
     }

}     
Comments: