26th Jan 2023, 6:07 AM
Awal Sharif
1 Answer
+ 3
public class Main { public static void main(String[] args) { Purchase customer = new Purchase(); Purchase specialCustomer = new Purchase(){ //your code goes here public int totalAmount(int price){ return price - (price*20)/100; } }; System.out.println(customer.totalAmount(1000)); System.out.println(specialCustomer.totalAmount(100000)); } } class Purchase { int price; public int totalAmount(int price) { return price - (price*10)/100; } }
26th Jan 2023, 6:15 AM
đŸ’«AsđŸ’«
đŸ’«AsđŸ’« - avatar