011-003-006
Constructor Chain: Product Information
Easy
Problem Description
constructor Chain: Product Information
In this problem, you will create a program that implements constructor chaining with this(), accepts a product name as input, and displays the product information to standard output.
Learning Objective: Initialize progressively with this()
Create a product class. Define 1-parameter, 2-parameter, and 3-parameter constructors, and link them with this() for progressive initialization.
Input
Line 1: Product name (string)
Output
Product: [name]
Price: 0 yen
Category: Unclassified
Ready to Try Running Code?
Log in to access the code editor and execute your solutions for this problem.
Don't have an account?
Sign Up