parameterized constructor – Computer Sir Ki Class

Login


Lost your password?

Don't have an account ?
Register (It's FREE) ×
  

Login
[lwa]



Exam Questions-ICSE2016-03C #JAVA#4240    siteicon   siteicon  

Problem Statement - parameterized constructor

What is a parameterized constructor?

Solution

TC++ #4240

A parameterized constructor is a method with the name same as of class and with some arguments or parameters passed to it. It is often used to initialise the object being created.
class Test
{
Test(int x)
{
t=x;
}
}
Here Test(int x) is a parameterized constructor


Share

sunmitra| Created: 31-Mar-2018 | Updated: 16-Apr-2019|ICSE2016









Back