約 27,100,000 件の結果
リンクを新しいタブで開く
  1. Can I call a constructor from another constructor (do constructor ...

    2008年11月21日 · When calling a constructor it actually allocates memory, either from the stack or from the heap. So calling a constructor in another constructor creates a local copy.

  2. .net - Calling the base constructor in C# - Stack Overflow

    If you need to call the base constructor in the middle of the override, then extract it to an actual method on the base class that you can call explicitly. The assumption with base constructors is …

  3. Interface defining a constructor signature? - Stack Overflow

    While you can't define a constructor signature in an interface, I feel it's worth mentioning that this may be a spot to consider an abstract class. Abstract classes can define unimplemented …

  4. Can a struct have a constructor in C++? - Stack Overflow

    In C++ the only difference between a class and a struct is that members and base classes are private by default in classes, whereas they are public by default in structs. So structs can have …

  5. c++ - Inheriting constructors - Stack Overflow

    The compiler creates a default constructor (one with no arguments) and a default copy constructor (one with an argument which is a reference to the same type). But if you want a …

  6. c# - Can constructors be async? - Stack Overflow

    2011年11月16日 · Constructor acts very similarly to a method returning the constructed type. And async method can't return just any type, it has to be either “fire and forget” void, or Task. If the …

  7. function - Purpose of a constructor in Java? - Stack Overflow

    2013年11月13日 · A constructor is used to create an instance of the class Card. And you'll need to call it 52 times to have 52 cards: new Card(1, "hearts"), etc. Now each instance of Player (you …

  8. C++, What does the colon after a constructor mean?

    2010年5月7日 · An initializer list is how you pass arguments to your member variables' constructors and for passing arguments to the parent class's constructor. If you use = to …

  9. Can an abstract class have a constructor? - Stack Overflow

    2008年11月4日 · The same case applies to abstract classes. Though we cannot create an object of an abstract class, when we create an object of a class which is concrete and subclass of the …

  10. Do constructors always have to be public? - Stack Overflow

    2015年6月23日 · The constructor is not always declared as public, it can also be private, protected, or default. The private constructors prevent a class from fully and clearly …