why do you need a variable in catch exception and how do you use each it the same as the detailed exception?
TemperatureException and e
TooColdException and e
for example:
try {
cust.drinkCoffee(cup);
System.out.println("Coffee is just right.");
}
catch (TemperatureException e) {
// This catches TooColdException, TooHotException,
// as well as TemperatureException....
variable exception in java
TemperatureException and e
TooColdException and e
for example:
try {
cust.drinkCoffee(cup);
System.out.println("Coffee is just right.");
}
catch (TemperatureException e) {
// This catches TooColdException, TooHotException,
// as well as TemperatureException....
variable exception in java