Top "Constructor" questions

A special type of subroutine called at the creation of an object.

difference between variables inside and outside of __init__()

Is there any difference at all between these classes besides the name? class WithClass (): def __init__(self): self.value = "Bob" …

python class oop constructor
Java Constructor Inheritance

I was wondering why in java constructors are not inherited? You know when you have a class like this: public …

java inheritance constructor
Hide Utility Class Constructor : Utility classes should not have a public or default constructor

I am getting this warning on Sonar.I want solution to remove this warning on sonar. My class is like …

java constructor sonarqube
What's wrong with overridable method calls in constructors?

I have a Wicket page class that sets the page title depending on the result of an abstract method. public …

java oop inheritance constructor overriding
C# static class constructor

Is there a work around on how to create a constructor for static class? I need some data to be …

c# class static constructor
Inheritance with base class constructor with parameters

Simple code: class foo { private int a; private int b; public foo(int x, int y) { a = x; b = y; } } …

c# inheritance constructor
Getting error: ISO C++ forbids declaration of with no type

I'm getting the following errors: ISO C++ forbids declaration of ttTreeInsert with no type ISO C++ forbids declaration of ttTreeDelete …

c++ function class constructor declaration
Code snippet or shortcut to create a constructor in Visual Studio

What is the code snippet or shortcut for creating a constructor in Visual Studio? Visual Studio 2010 and C#.

c# visual-studio constructor code-snippets shortcut
Class constructor type in typescript?

How can I declare a class type, so that I ensure the object is a constructor of a general class? …

class typescript types constructor
Accessing constructor of an anonymous class

Lets say I have a concrete class Class1 and I am creating an anonymous class out of it. Object a = …

java constructor overloading anonymous-types