About 97,600 results
Open links in new tab
  1. Constructors - C# | Microsoft Learn

    Mar 15, 2025 · A constructor in C# is called when a class or struct is created. Use constructors to set defaults, limit instantiation, and write flexible, easy-to-read code.

  2. Constructors in C++ - GeeksforGeeks

    4 days ago · There are 4 types of constructors in C++: 1. Default Constructor. A default constructor is automatically created by the compiler if no constructor is defined. It takes no arguments and …

  3. Constructor (object-oriented programming) - Wikipedia

    In class-based, object-oriented programming, a constructor (abbreviation: ctor) is a special type of function called to create an object. It prepares the new object for use, often accepting arguments that …

  4. C++ Constructors - W3Schools

    Think of it like this: When you order a pizza (object), the constructor is the chef who adds the sauce, cheese, and toppings before it gets to you - you don't have to do it yourself!

  5. constructor - JavaScript | MDN

    Jul 20, 2025 · The constructor method is a special method of a class for creating and initializing an object instance of that class.

  6. 14.9 — Introduction to constructors – Learn C++ - LearnCpp.com

    Dec 29, 2024 · We must need a matching constructor. But what the heck is that? A constructor is a special member function that is automatically called after a non-aggregate class type object is created.

  7. Java - Constructors

    Java constructors are special types of methods that are used to initialize an object when it is created. It has the same name as its class and is syntactically similar to a method. However, constructors have …

  8. What Is a Constructor? - Computer Hope

    Jun 1, 2025 · In object-oriented programming, a constructor is a method or function for creating an instance of the class that it belongs. It has no return value and is usually identified by having the …

  9. Constructors - an overview | ScienceDirect Topics

    Constructors are special methods in object-oriented programming (OOP) that are executed whenever an object is created from a class, and they usually contain instructions to initialize an object’s variables …

  10. Providing Constructors for Your Classes (The Java™ Tutorials - Oracle

    Providing Constructors for Your Classes A class contains constructors that are invoked to create objects from the class blueprint. Constructor declarations look like method declarations—except that they …