Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ProductPrinter {
- public static void main(String[] args) {
- Product backpack = new Product("Targus Backpack" , 34.67);
- Product book = new Product("A Game of Thrones" , 28.95);
- System.out.println(backpack.getName());
- System.out.println(backpack.getPrice());
- System.out.println(book.getName());
- System.out.println(book.getPrice());
- backpack.reducePrice(5.00);
- book.reducePrice(5.00);
- System.out.println("New price of backpack is " + backpack.getPrice());
- System.out.println("New price of book is " + book.getPrice());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment