This site requires JavaScript, please enable it in your browser!
Greenfoot back
jogit666
jogit666 wrote ...

2014/10/9

What will the following method do?

jogit666 jogit666

2014/10/9

#
import greenfoot.*;
abstract public class AugmentedRobot extends UrRobot
{
    public void turnOff()
    {
        super.turnOff();
        Greenfoot.stop();
    }
}
Will turnOff() of AugmentedRobot refer to the UrRobot's turnOff(), and then in addition do Greenfoot.stop()?
danpost danpost

2014/10/9

#
Yes -- since 'UrRobot' is the superclass of 'AugmentedRobot', that is exactly what it will do.
You need to login to post a reply.