/** * Write a description of class Shoes here. * * @author (your name) * @version (a version number or a date) */ public class Shoes implements Stretchable, Running { // instance variables - replace the example below with your own private int distance = 0; private boolean on = false; /** * Retezec popisujici objekt * @return "Shoes has run and are on/off */ public String toString(){ return "Shoes has run " + distance + " and are " + (on?"on":"off"); } public void run(int value) { if (on) { distance += value; } } public boolean putOff() { boolean canIPutOff = false; if (on) { canIPutOff = true; on = false; } return canIPutOff; } public boolean putOn() { boolean canIPutOn = false; if (!on) { canIPutOn = true; on = true; } return canIPutOn; } }