Results 1 to 14 of 14

What is constructer

This is a discussion on What is constructer within the Programming forums, part of the Web Designing & Development category; What is constructer...

  1. #1
    Junior Member
    Join Date
    Sep 2014
    Posts
    24

    Default What is constructer

    What is constructer

  2. #2
    Newbie
    Join Date
    Sep 2014
    Posts
    4

    Default Re: What is constructer

    Constructor is a member function of class .It is used to initialize a object of class.

  3. #3
    Junior Member
    Join Date
    Nov 2013
    Location
    Australia
    Posts
    29

    Default Re: What is constructer

    A constructer is a special type of class which create an object. A constructer resemble an instance method.

  4. #4
    Member
    Join Date
    May 2014
    Posts
    38

    Default Re: What is constructer

    This is really useful information about constructor.

  5. #5
    Senior Member
    Join Date
    May 2014
    Posts
    206

    Default Re: What is constructer

    A constructor is a bit of code that allows you to create objects from a class. You call the constructor by using the keyword new , followed by the name of the class, followed by any necessary parameters.

  6. #6
    Senior Member
    Join Date
    Oct 2014
    Posts
    187

    Default Re: What is constructer

    Constructor is a special type of function because its name is same as class name. Constructor is a special type of function because its name is same as class name. There r three type of constructor which r copy,default, parametrized constructor .Its allocate memory when it called.

  7. #7
    Junior Member
    Join Date
    Oct 2014
    Posts
    24

    Default Re: What is constructer

    A constructor is a bit of code that allows you to create objects from a class. You call the constructor by using the keyword new , followed by the name of the class, followed by any necessary parameters. For example, if you have a Dog class, you can create new objects of this type by saying new Dog() .

  8. #8
    Senior Member
    Join Date
    Jul 2014
    Location
    Singapore
    Posts
    114

    Default Re: What is constructer

    A constructor is a bit of code that allows you to create objects from a class. You call the constructor by using the keyword new , followed by the name of the class, followed by any necessary parameters. For example, if you have a Dog class, you can create new objects of this type by saying new Dog() .

  9. #9
    Senior Member
    Join Date
    Jun 2015
    Posts
    940

    Default Re: What is constructer

    A constructor is a special method of a class or structure in object-oriented programming that initializes an object of that type. A constructor is an instance method that usually has the same name as the class, and can be used to set the values of the members of an object, either to default or to user-defined values.

  10. #10
    Senior Member
    Join Date
    Aug 2015
    Posts
    302

    Default Re: What is constructer

    A class constructor is a special member function of a class that is executed whenever we create new objects of that class.A constructor will have exact same name as the class and it does not have any return type at all, not even void. Constructors can be very useful for setting initial values for certain member variables.

  11. #11
    Junior Member
    Join Date
    Sep 2015
    Posts
    17

    Default Re: What is constructer

    A constructor is a special method of a class or structure in object-oriented programming that initializes an object.

  12. #12
    Junior Member
    Join Date
    Dec 2015
    Posts
    22

    Default Re: What is constructer

    A constructor is responsible for preparing the object for action, and in particular establishing initial values for all its data, i.e. its data members. Although it plays a special role, the constructor is just another member function, and in particular can be passed information via its argument list that can be used to initialise it. The name of the constructor function is the name of the class

  13. #13
    Senior Member
    Join Date
    Jan 2016
    Posts
    145

    Default Re: What is constructer

    Hey,
    Constructor in a class is a subroutine to create an object.When you need to call the constructor,it is called by using the keyword,followed by the name of the class,followed by parameters if necessary.
    Constructors are of many types,namely:

    • Parameterized constructors
    • Default constructors
    • Copy constructors
    • Conversion constructors
    • Move constructors

  14. #14
    Senior Member
    Join Date
    Jan 2012
    Posts
    2,044

    Default Re: What is constructer

    A constructor is a special method of a class or structure in object-oriented programming that initializes an object of that type. A constructor is an instance method that usually has the same name as the class, and can be used to set the values of the members of an object, either to default or to user-defined values.