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); } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter