give me one example of default constructor
Answers
Explanation:
When a class constructor does not explicitly call the constructor of one of its object-valued fields in its initializer list, the default constructor for the field's class is called. ... E.g. vector<MyClass>(10); initializes the vector with ten elements, which are filled with a default-constructed MyClass object.
hope it helps ☺️!!!
please mark the answer as brainliest
follow me.......
Answer:
The default constructor initializes instance variables with default values. For example, the int variable will be initialized to 0; Constructor types: No-Arg Constructor - a constructor that does not accept any arguments Parameterizedconstructor - a constructor that accepts arguments Default Constructor - a constructor that is automatically created by the Java compiler if it is not explicitly defined. A constructor cannot be abstract or static or final.