newobj instance void zzz::.ctor() 在記憶體建立物件,呼叫 .ctor。證明 IL 非低階組語,保有物件導向高階語意。
thisldarg.0 載入移除堆疊頂端元素(如 newobj 留下的物件參考),避免堆疊不平衡。
.method private hidebysig specialname rtspecialname static void .cctor() il managed {
ldstr "byes"
call void [mscorlib]System.Console::WriteLine(class System.String)
ret
}
輸出順序:byes → hi → bye(.cctor → Main → .ctor)