Write a program to store two objects of product class (int id, String name, String color, float price) in the file name called "productinfo.txt". Use the concept of the constructor to initialize the object of the class.
Answers
Answered by
0
Answer:
ExpCan we have both default constructor and parameterized constructor in the same class?
When you define another constructor in your class, you do not get the "usual" default constructor (public and without arguments) anymore. ... The constructors can call each-other (using this(parameters) ) or shared methods if there is common functionality inlanation:
Similar questions
Math,
3 months ago
English,
3 months ago
Math,
3 months ago
Social Sciences,
7 months ago
Science,
1 year ago