My Project
VirtualPerson.java
Go to the documentation of this file.
1 class VirtualPerson {
2  private static final int tooCold = 65;
3  private static final int tooHot = 85;
4  public void drinkCoffee(CoffeeCup cup) throws
6  int temperature = cup.getTemperature();
7  if (temperature <= tooCold) {
8  throw new TooColdException();
9  }
10  else if (temperature >= tooHot) {
11  throw new TooHotException();
12  }
13  //...
14  }
15  public void slurp(CoffeeCup cup) throws
17  int temperature = cup.getTemperature();
18  if (temperature <= tooCold) {
19  throw new Exception1();
20  }
21  else if (temperature >= tooHot) {
22  throw new Exception2();
23  }
24  //...
25  }
26  //...
27 }
void drinkCoffee(CoffeeCup cup)
static final int tooCold
void slurp(CoffeeCup cup)
static final int tooHot