I need help please | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
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
A S Raghuvanshi
A S Raghuvanshi - avatar