Classes are at the core of C++ programming language, but it takes time to compile and debug using C++. If you want to learn about the very basics of classes, I suggest you give Powershell a try.
This sample will cover inheritance, classes, and instantiation.
Creating a simple class:
class Computers { [string]$brand; [int]$year; Computers() { write-host -object "Called without any parameters" } Computers ([string]$brand,[int]$year) { $this.brand = $brand; $this.year = $year } }
Instantiation of your new class:
$myNew = [Computers]::new() $myNew2 = [Computers]::new("Asus",2020)
Inheritance of your new class:
class IT : Computers { Hardware() { } }