Advertisement
Mmmag2

Untitled

Apr 21st, 2025
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. import java.util.ArrayList;
  2.  
  3.  
  4. public class Recipe {
  5.  
  6. private String name;
  7. private int cookingTime;
  8. private ArrayList<String> ingredients;
  9.  
  10. public Recipe(String name, int cookingTime){
  11. this.name = name;
  12. this.cookingTime = cookingTime;
  13. }
  14.  
  15. public String toString(){
  16. return name + ", cooking time: " + this.cookingTime;
  17. }
  18.  
  19. public void addRecipe(ArrayList<String> array){
  20. this.ingredients = array;
  21. }
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement