Skip to main content
Commonmark migration
Source Link

In both Java and C#, a "default constructor" refers to a nullary constructor that is automatically generated by the compiler if no constructors have been defined for the class. The default constructor implicitly calls the superclass's nullary constructor, then executes an empty body.

 

Wikipedia: Default Constructor

In both Java and C#, a "default constructor" refers to a nullary constructor that is automatically generated by the compiler if no constructors have been defined for the class. The default constructor implicitly calls the superclass's nullary constructor, then executes an empty body.

 

Wikipedia: Default Constructor

In both Java and C#, a "default constructor" refers to a nullary constructor that is automatically generated by the compiler if no constructors have been defined for the class. The default constructor implicitly calls the superclass's nullary constructor, then executes an empty body.

Wikipedia: Default Constructor

added 6 characters in body
Source Link
candied_orange
  • 119.7k
  • 27
  • 233
  • 369

... you can't make up your mind what your object should depend on. If you can think of many ways to build the same object then you write many constructors that makebuild it those many ways.

... you can't make up your mind what your object should depend on. If you can think of many ways to build the same object you write many constructors that make it those many ways.

... you can't make up your mind what your object should depend on. If you can think of many ways to build the same object then you write many constructors that build it those many ways.

added 2 characters in body
Source Link
candied_orange
  • 119.7k
  • 27
  • 233
  • 369

Ugg. Look, there are constructors that return"return" strings just fine. They all live in the String class.

No you haven't. Outputting is not returning. Your constructors don't return strings. They return"return" objects of the HelloWorldConstructor type.

Ugg. Look, there are constructors that return strings just fine. They all live in the String class.

No you haven't. Outputting is not returning. Your constructors don't return strings. They return objects of the HelloWorldConstructor type.

Ugg. Look, there are constructors that "return" strings just fine. They all live in the String class.

No you haven't. Outputting is not returning. Your constructors don't return strings. They "return" objects of the HelloWorldConstructor type.

added 33 characters in body
Source Link
candied_orange
  • 119.7k
  • 27
  • 233
  • 369
Loading
deleted 1 character in body
Source Link
candied_orange
  • 119.7k
  • 27
  • 233
  • 369
Loading
added 76 characters in body
Source Link
candied_orange
  • 119.7k
  • 27
  • 233
  • 369
Loading
added 76 characters in body
Source Link
candied_orange
  • 119.7k
  • 27
  • 233
  • 369
Loading
Source Link
candied_orange
  • 119.7k
  • 27
  • 233
  • 369
Loading