Classes: Multiple Fields

PHOTO EMBED

Wed Sep 21 2022 03:14:04 GMT+0000 (Coordinated Universal Time)

Saved by @cruz #javascript

public class Store {
  // instance fields
  String productType;
  int inventoryCount;
  double inventoryPrice;
  
  // constructor method
  public Store(String product,int count,double price) {
    productType = product;
    inventoryCount = count;
    inventoryPrice = price;
  }
  
  // main method
  public static void main(String[] args) {
    Store cookieShop = new Store("cookies",12, 3.75);
   
  }
}
content_copyCOPY