With parameters
Classes / Constructors
Default constructor
Primary constructor
Without parameters
With parameters
With default parameter values
Calling the parent constructor
Constructor chaining
Overriding the parent constructor
Initialization block
class
Man
(
var
name:
String
)
val
man =
Man
(
"Alex"
)
//man.name
is
"Alex"
Languages
Python
C++
Java
C#
JavaScript
R
Rust
Golang
Delphi
PHP
Ruby
Swift
Lua
TypeScript
Clojure
Objective-C