Reply to comment

Constructors

  • The constructor is executed whenever an instance of a class comes into scope
  • A constructor does not return a value; it creates an object. Therefore:
    • You cannot specify a return type when declaring a constructor (not even void)
    • A constructor cannot contain a return a statement

Reply

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options