content: // --- Product 1 --> Burger ---
  interface Burger {
      void prepare();
  }
  
  class BasicBurger implements Burger {
      public void prepare() {
          System.out.println("Preparing Basic Burger with bun, patty, and ketchup!");
      }
  }
  
  class StandardBurger implements Burger {
      public void prepare() {
          System.out.println("Preparing Standard Burger with bun, patty, cheese, and lettuce!");
      }
  }
  
  class PremiumBurger implements Burger {
      public void prepare() {
          System.out.println("Preparing Premium Burger with gourmet bun, premium patty, cheese, lettuce, and secret sauce!");
      }
  }
  
  class BasicWheatBurger implements Burger {
      public void prepare() {
          System.out.println("Preparing Basic Wheat Burger with bun, patty, and ketchup!");
      }
  }
  
  class StandardWheatBurger implements Burger {
      public void prepare() {
          System.out.println("Preparing Standard Wheat Burger with bun, patty, cheese, and lettuce!");
      }
  }
  
  class PremiumWheatBurger implements Burger {
      public void prepare() {
          System.out.println("Preparing Premium Wheat Burger with gourmet bun, premium patty, cheese, lettuce, and secret sauce!");
      }
  }
  
  // --- Product 2 --> GarlicBread ---
  interface GarlicBread {
      void prepare();
  }
  
  class BasicGarlicBread implements GarlicBread {
      public void prepare() {
          System.out.println("Preparing Basic Garlic Bread with butter and garlic!");
      }
  }
  
  class CheeseGarlicBread implements GarlicBread {
      public void prepare() {
          System.out.println("Preparing Cheese Garlic Bread with extra cheese and butter!");
      }
  }
  
  class BasicWheatGarlicBread implements GarlicBread {
      public void prepare() {
          System.out.println("Preparing Basic Wheat Garlic Bread with butter and garlic!");
      }
  }
  
  class CheeseWheatGarlicBread implements GarlicBread {
      public void prepare() {
          System.out.println("Preparing Cheese Wheat Garlic Bread with extra cheese and butter!");
      }
  }
  
  // --- Abstract Factory ---
  interface MealFactory {
      Burger createBurger(String type);
      GarlicBread createGarlicBread(String type);
  }
  
  // --- Concrete Factory 1 ---
  class SinghBurger implements MealFactory {
      public Burger createBurger(String type) {
          if (type.equalsIgnoreCase("basic")) {
              return new BasicBurger();
          } else if (type.equalsIgnoreCase("standard")) {
              return new StandardBurger();
          } else if (type.equalsIgnoreCase("premium")) {
              return new PremiumBurger();
          } else {
              System.out.println("Invalid burger type!");
              return null;
          }
      }
  
      public GarlicBread createGarlicBread(String type) {
          if (type.equalsIgnoreCase("basic")) {
              return new BasicGarlicBread();
          } else if (type.equalsIgnoreCase("cheese")) {
              return new CheeseGarlicBread();
          } else {
              System.out.println("Invalid Garlic bread type!");
              return null;
          }
      }
  }
  
  // --- Concrete Factory 2 ---
  class KingBurger implements MealFactory {
      public Burger createBurger(String type) {
          if (type.equalsIgnoreCase("basic")) {
              return new BasicWheatBurger();
          } else if (type.equalsIgnoreCase("standard")) {
              return new StandardWheatBurger();
          } else if (type.equalsIgnoreCase("premium")) {
              return new PremiumWheatBurger();
          } else {
              System.out.println("Invalid burger type!");
              return null;
          }
      }
  
      public GarlicBread createGarlicBread(String type) {
          if (type.equalsIgnoreCase("basic")) {
              return new BasicWheatGarlicBread();
          } else if (type.equalsIgnoreCase("cheese")) {
              return new CheeseWheatGarlicBread();
          } else {
              System.out.println("Invalid Garlic bread type!");
              return null;
          }
      }
  }
  
  // --- Main Class ---
  public class AbstractFactory {
      public static void main(String[] args) {
          String burgerType = "basic";
          String garlicBreadType = "cheese";
  
          MealFactory mealFactory = new SinghBurger();
  
          Burger burger = mealFactory.createBurger(burgerType);
          GarlicBread garlicBread = mealFactory.createGarlicBread(garlicBreadType);
  
          if (burger != null) burger.prepare();
          if (garlicBread != null) garlicBread.prepare();
      }
  }
  