Miscellany
- public class Main
- {
- //定義兩個SuperPlayers class的物件作為players
- SuperPlayers Justin;
- SuperPlayers HoYin;
- public Main()
- {
- Justin=new SuperPlayers("Justin");
- HoYin=new SuperPlayers("HoYin");
- }
- //宣告Justin物件的attack方法直到任何一方死去
- public void Attack()
- {
- do
- {
- Justin.Attack(HoYin);
- }
- while
- ((Justin.isDead | HoYin.isDead) == false);
- }
- public static void main(String argv[])
- {
- Main main=new Main();
- //宣告這個類別的attack方法
- main.Attack();
- }
- }