class Player extends animObj implements Animate{
public void moveLeft(animObj obj){} // moves the animation object left.
public void moveRight(animObj obj){}// moves the animation object right.
private void moveUp(animObj obj){} // moves the animation object up.
public void moveDown(animObj obj){} // moves the animation object down.
public void Jump(animObj obj){} // makes the animation object jump.
public void Run(animObj obj){} // makes the animation object run.
public void Run(animObj obj, int x, int y){}
}//end of Player
class animObj{
//animation object code goes here...
}//end of animObj
class M{}
class P extends M{}
class c2p3{
public static void main(String[] args){
M m = new M();
P p = new P();
m = c2p3.ReturnIt(p); //Line 7
}
static M ReturnIt(M obj){
return(obj); // Remember you can return sub-types of a type!
}
}
class A{
int a;
int doAStuff(){
B b = new B();
a = b.doBStuff();
return a;
}
int doMoreAStuff(){
B b = new B();
a = b.doBStuff();
return a;
}
}
class B{
int b;
int doBStuff(){
A a = new A();
b = a.doMoreAStuff();
return b;
}
}