Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write an abstract function named receivePay in interface with return type double and no parameters. Write another incomplete function, name Show with return type
Write an abstract function named receivePay in interface with return type double and no parameters. Write another incomplete function, name Show with return type void and an argument of type int in that interface. Build a class with name Bill that implements the above interface. Bill class with name Billld, itemsquantity and itemsprice with proper datatypes with private access. Define two constructors, one default and other is parameterized to initialize the class members. Now receivePay has to be implemented in such a way that its displays product of itemsquantity and itemsprice and Display function will display the Billld.Can we do same task with abstract class instead of interface?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Java interface Payment double receivePay void Showint item class Bill implements Payment private Str...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started