You are viewing a single comment's thread. Return to all comments →
//write your code here if(order.equals("cake")){ return new Cake(); }else if(order.equals("pizza")){ return new Pizza(); } return null;
Just by adding above it'll work with Java8
Seems like cookies are disabled on this browser, please enable them to open this website
Java Factory Pattern
You are viewing a single comment's thread. Return to all comments →
//write your code here if(order.equals("cake")){ return new Cake(); }else if(order.equals("pizza")){ return new Pizza(); } return null;
Just by adding above it'll work with Java8