Home > Back-end >  Upcasting bosses can see down the code under the optimization for bosses
Upcasting bosses can see down the code under the optimization for bosses

Time:09-29

The class mode
{
Void the Activity ()
{
System. The out. Println (" the tiger in the zoo, the fish, ostrich and movement of the frog ");
}
}
The class tiger extends mode
{
Void the Activity ()
{
System. Out.println (" tiger: land, my site!" );
}
}
The class fish extends mode
{
Void the Activity ()
{
System. The out. Println (" fish: I am in the water ");
}
}
The class ostrich extends mode
{
Void the Activity ()
{
System. The out. Println (" ostrich: sky, why so far away from the case ");
}
}
The class frog extends mode
{
Void the Activity ()
{
System. Out.println (" frog: barrier, the distance? That's all right ");
}
}
The class Main
{
Public static void main (String [] args)
{
Mode a=new mode ();
A.A ctivity ();
Mode b=new tiger ();
B.A ctivity ();
Mode c=new ostrich ();
C.a. ctivity ();
Mode d=new fish ();
Da ctivity ();
Mode e=new frog ();
E.A ctivity ();
}
}

CodePudding user response:

Simple polymorphism using, there's nothing to optimization, optimization, and it isn't necessary cheer
  • Related