Created
February 21, 2011 05:03
-
-
Save thetekst/836673 to your computer and use it in GitHub Desktop.
exx Crocodile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Crocodile { | |
private long t; | |
private boolean state; | |
public Crocodile(){//создание крокодила | |
} | |
public double getWeight(){//возвращает вес | |
return 45; | |
} | |
public void kill(){//убить крокодила | |
} | |
public String getState(){//получает состояние | |
return if(state == true){System.out.println("Крокодил жив")} | |
else{System.out.println("Крокодил мертв")}; | |
} | |
long tm = System.currentTimeMillis(); | |
public static void main(String args[]) throws InterruptedException{ | |
Crocodile c = new Crocodile(); | |
do{ | |
Thread.sleep(500);//задержка | |
System.out.println(c.getState());//вывод_состояния_крокодила; | |
}while(c.getWeight()<100); | |
c.kill(); | |
//вывод_состояния_крокодила; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment