Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Jan 2019
    Location
    Jaipur
    Posts
    10

    purpose of a default constructor ?

    Hello Dear,

    Please Tell Me What is the purpose of a default constructor ?

  2. #2
    Senior Member
    Join Date
    Jul 2019
    Posts
    110
    Constructors are mostly used to initialize the instance variables.
    Specifically, using default constructors the instance variables will be initialized with fixed values for all objects.

  3. #3
    Member
    Join Date
    Jul 2019
    Posts
    86
    A default constructor is a constructor which can be called with no arguments, either defined with an empty parameter list, or with default arguments provided for every parameter.

  4. #4
    Member
    Join Date
    Jul 2019
    Posts
    67
    A default constructor is a constructor which constitutes of no arguments, it can be said with an empty parameter list or else with default arguments that provides for every parameter.

  5. #5
    Member
    Join Date
    Jul 2019
    Posts
    75
    Constructor which constitues of no arguments with empty parameters list is known as default constructor.

  6. #6
    Senior Member
    Join Date
    Jul 2019
    Posts
    120
    It is a special type of method which is used to initialize the object. Every time an object is created using the new keyword, at least one constructor is called. It calls a default constructor if there is no constructor available in the class. In such case, Java compiler provides a default constructor by default.

  7. #7
    Member
    Join Date
    Jul 2019
    Posts
    60
    When you create an object, you need to initialize its data members. As you know, private and protected data members can be accessed outside the class by using public member functions of the class. C++ offers a special function, called constructor, which makes the initialization of an object. A constructor is a special function that is called every time you create an object.

  8. #8
    Member
    Join Date
    Jun 2019
    Posts
    52
    Constructor is a special function which has the same name as of class name. Constructors don't have return type and they don't return any value. Default Constructor is mainly used for the initialization purpose.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

  Find Web Hosting      
  Shared Web Hosting UNIX & Linux Web Hosting Windows Web Hosting Adult Web Hosting
  ASP ASP.NET Web Hosting Reseller Web Hosting VPS Web Hosting Managed Web Hosting
  Cloud Web Hosting Dedicated Server E-commerce Web Hosting Cheap Web Hosting


Premium Partners:


Visit forums.thewebhostbiz.com: to discuss the web hosting business, buy and sell websites and domain names, and discuss current web hosting tools and software.