You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We get the exception because in file src/headfirst/designpatterns/command/dinerLambda/Customer.java
on line 12 we make just declaration of Lambda-object as a local variable, and not save the Lambda-object in instance variable "o":
public void createOrder() {
Order o = () -> { cook.makeBurger(); cook.makeFries(); };
}
Therefore we have null-object in file src/headfirst/designpatterns/command/dinerLambda/Waitress.java
on line 8: order.orderUp();
The text was updated successfully, but these errors were encountered:
We get the exception because in file
src/headfirst/designpatterns/command/dinerLambda/Customer.java
on line 12 we make just declaration of Lambda-object as a local variable, and not save the Lambda-object in instance variable "
o
":Therefore we have
null
-object in filesrc/headfirst/designpatterns/command/dinerLambda/Waitress.java
on line 8:
order.orderUp();
The text was updated successfully, but these errors were encountered: