school/java/old/productClass/testProduct.java

23 lines
557 B
Java
Raw Permalink Normal View History

2021-01-27 10:39:36 -05:00
public class testProduct {
public static void main(String[] args) {
Product jeans = new Product("jeans", 12.34, 75);
System.out.println(
"Name: " + jeans.getCode() +
"\nPrice: " + jeans.getPrice() +
"\nCount: " + jeans.getCount());
jeans.setCode("New Jeans");
jeans.setPrice(10.0);
jeans.addInventory(5);
System.out.println(
"Name: " + jeans.getCode() +
"\nPrice: " + jeans.getPrice() +
"\nCount +5 : " + jeans.getCount());
jeans.sellInventory(20);
System.out.println(
"Count -20 : " +jeans.getCount());
}
}