explicit return type. Constructors cannot be directly invoked (the keyword “new” invokes them). Constructors should not have non-access modifiers. Java constructors perform the following tasks in the following order: Call the default constructor of the superclass if no constructor is defined. Initialize member variables to the specified values. Executes the body of the constructor. Java permit users to call one constructor in another constructor using this() keyword. But this() must be first statement. class Example { Example() // Non-parameterized constructor { this(1); // Calling of constructor System.out.println("0-arg-cons"); } Example(int a) // Parameterized constructor { System.out.println("1-arg-cons"); } } public static void main(String[] args) { Example e = new Example(); } Java provides access to the superclass's constructor through the super keyword. public class Example { // Definition of the constructor. public Example() { this(1); } // Overloading a constructor public Example(int input) { data = input; // This is an assignment } // Declaration of instance variable(s). private int data; } // Code somewhere else // Instantiating an object with the above constructor Example e = new Example(42); A constructor taking zero number of arguments is called a "no-arguments" or "no-arg" constructor. JavaScript As of ES6, JavaScript has direct constructors like many other programming languages. They are written as such class FooBar { constructor(baz) { this.baz = baz } } This can be instantiated as such const foo = new FooBar('7') The equivalent of this before ES6, was creating a function that instantiates an object as such function FooBar (baz) { this.baz = baz; } This is instantiated the same way as above. Object Pascal In Object Pascal, the constructor is similar to a factory method. The only syntactic difference to regular methods is the keyword constructor in front of the name (instead of procedure or function). It can have any name, though the convention is to have Create as prefix, such as in CreateWithFormatting. Creating an instance of a class works like calling a static method of a class: TPerson.Create('Peter'). program OopProgram; type TPerson = class private FName: string; public property Name: string read FName; constructor Create(AName: string); end; constructor TPerson.Create(AName: string); begin FName := AName; end; var Person: TPerson; begin Person := TPerson.Create('Peter'); // allocates an instance of TPerson and then calls TPerson.Create with the parameter AName = 'Peter' end. OCaml In OCaml, there is one constructor. Parameters are defined right after the class name. They can be used