Example of parameterized constructor
class cons
{ ㄴ
int rinei
double mksi
cons Cint ab, double mlll paramete-
rizedo constructor
{
al;
mks = ml ;
rino =
Answers
Answered by
0
Explanation:
Example of Parameterized Constructor
For example, when we create the object like this MyClass obj = new MyClass(123, "Hi"); then the new keyword invokes the Parameterized constructor with int and string parameters (MyClass(int, String)) after object creation.
Similar questions
English,
2 months ago
Social Sciences,
2 months ago
Hindi,
2 months ago
Social Sciences,
4 months ago
Math,
4 months ago
Math,
9 months ago
Science,
9 months ago
Hindi,
9 months ago