Exercise 2: Static vs. Instance Members — Possible Solution ==================================================================== WHY [Math]::Pow(2, 10) NEEDS NO OBJECT CREATION ------------------------------ Per this chapter, [Math]::Pow(2, 10) calls a STATIC member - a member that belongs to the type itself, not to any particular created object. [Math] exposes only static members, and per this chapter there's no such thing as "an instance of Math" at all - which is why New-Object Math or [Math]::new() are never seen anywhere; there is nothing to instantiate in the first place. WHY $sb.Append("x") REQUIRES $sb TO ALREADY EXIST ------------------------------ Append is an INSTANCE member - it belongs to a specific, already-created StringBuilder object, and operates on that particular object's own internal state (its buffer). Without first creating an actual StringBuilder object (via New-Object or [Type]::new()) and storing it in $sb, there would be no specific object for .Append() to act on - calling .Append() requires a real instance to be the "this" that the method operates against. THE UNDERLYING DISTINCTION ------------------------------ Per this chapter, [Type]::Member syntax always means "call this directly on the type itself" (static), while a variable's own .Member syntax always means "call this on the specific object that variable holds" (instance). Math is a type made up entirely of static members with no concept of an instance; StringBuilder is a type whose useful members (like Append) are instance members that require a real, created object to operate on. WHY THIS WORKS AS AN ANSWER ------------------------------ It correctly explains that Pow is static (belongs to the type, no instance needed) while Append is an instance member (requires an actual created object), and correctly states the general static-vs-instance distinction this chapter establishes.