23 lines
557 B
Java
23 lines
557 B
Java
|
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());
|
||
|
}
|
||
|
}
|