CLASE FELINO
public class felino {
int npatas=4;
public felino() {
}
public void rugir()
{
System.out.println("Grrrrrrrrrrrrrrr");
}
}
______________________________________________________________________________________
CLASE GATO
public class gato extends felino {
public gato() {
}
public void maullar()
{
System.out.println("Miauuuuuuu");
}
}
________________________________________________________________________________
CLASE DEMOFELINO
/**
* @(#)demofelino.java
*
*
* @author
* @version 1.00 2011/11/22
*/
public class demofelino {
public static void main(String args[])
{
felino pantera=new felino();
gato felix=new gato();
pantera.rugir();
System.out.println("Felix Numero de patas"+felix.npatas);
felix.rugir();
felix.maullar();
}
}