Constructor overloading
suggest changeclass Person {
[string] $Name
[int] $Age
Person([string] $Name) {
$this.Name = $Name
}
Person([string] $Name, [int]$Age) {
$this.Name = $Name
$this.Age = $Age
}
}
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents