Question: Build a class called Product java. This class should have the following properties: pid, description and price. Also add the appropriate set and get methods,
Build a class called Product java. This class should have the following properties: pid, description and price. Also add the appropriate set and get methods, display method, toString method and main method. Main() should be used to test this class. Also add 2 constructors to the Product class. One that takes no arguments and initializes the data to all 0s and ""(empty strings). And one constructor that takes all arguments. Lastly in the main() method instantiate a Product object by calling the constructor that takes all 3 arguments, then call the display method to display the data. Main Testing Code rightarrow Product p1; p1 = new Product ("k77", "Blender", 69.00); p1. display()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
