Computer Science, asked by hardeepsingh1304qht, 7 months ago

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 luvsh567
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