Rather that break up the flow of the book with this content, these topics are covered here as bonus chapters.
Recommendation
Rather than break up the flow of the book with this content, these topics are covered here as bonus chapters.
Section: 14.3 Defining and creating a class (Creating a class using New-Object Callout)
States
PS C:\> $car = New-Object
Recommendation
PS C:\> $car = New-Object -TypeName Car
Section: 14.4 Adding class properties
States
Now that the class as some properties, we can assign values to them just like any other PowerShell variable:
Recommendation
Now that the class has some properties, we can assign values to them just like any other PowerShell variable:
Section: 14.10 Method overloading and signatures
States
New Drive() method that accepts a integer parameter
Recommendation
New Drive() method that accepts an integer parameter
Section: 14.12 Initializing a class instance with constructors
States
Another, more succinct want to create a class instance is using the cast constructor like so:
Recommendation
Another, more succinct way to create a class instance is using the cast constructor like so:
Section: 14.13.2 Overriding methods
States
I mentioned earlier that derived classes can overwrite methods from the base class. This capability is a useful feature to have, as it allows for code to exist in the base class, and instances of it, or derived classes can execute without modification, or create new versions of the method containing logic specific to them when appropriate.
Recommendation
I mentioned earlier that derived classes can overwrite methods from the base class. This capability is a useful feature to have, as it allows for code to exist in the base class, and instances of it, while derived classes can either execute without modification, or create new versions of the method containing logic specific to itself when appropriate.
Or, even more explicitly stated:
I mentioned earlier that derived classes can overwrite methods from the base class. This capability is a useful feature to have, as it allows for code to exist in the base class, and instances of it. Additionally, derived classes can either execute a derived method without modification, or create new versions of the method containing logic specific to the derived class when appropriate.
Chapter 14
Section: Bonus Chapters
States
Recommendation
Section: 14.3 Defining and creating a class (Creating a class using New-Object Callout)
States
Recommendation
Section: 14.4 Adding class properties
States
Recommendation
Section: 14.10 Method overloading and signatures
States
Recommendation
Section: 14.12 Initializing a class instance with constructors
States
Recommendation
Section: 14.13.2 Overriding methods
States
Recommendation