You're building an online shop system. Fill the blanks in the code to create a Product class inside a package named com.myshop.products. The class should have an ID, name, and price, with a constructor to set these values.
Computer scienceProgramming languagesJavaCode organizationObject-oriented programmingClasses and objectsClasses and members
Grouping classes with packages
Shopping for code in the digital aisles
Report a typo
Fill in the gaps with the relevant elements
com.myshop.products;
Product {
int id;
private String name;
private double price;
public Product(int id, String name, double price) {
this.id = id; this.name = name; this.price = price;
}
}Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.