admin 管理员组

文章数量: 1086019


2023年12月24日发(作者:黄页免费版大全免费)

}

public Cat(int _notuse) { name = "Hello Kitty"; }

public void Shout() { ine(name+" is now nyan nyan"); }

}

其构造函数分别是:

.method public hidebysig specialname rtspecialname

instance void .ctor(string _name) cil managed{ // Code size 28 (0x1c) .maxstack 8 IL_0000: ldarg.0//this压栈 IL_0001: ldstr "Hello Tom”//将”Hello Tom”压栈 IL_0006: stfld string ::name//将”Hello Tom”赋值给 IL_000b: ldarg.0 IL_000c: call instance void [mscorlib]::.ctor() IL_0011: nop IL_0012: nop IL_0013: ldarg.0 IL_0014: ldarg.1 IL_0015: stfld string ::name IL_001a: nop IL_001b: ret

} // end of method Cat::.ctor

其他构造函数中同样会增加赋值的那三句

.method public hidebysig specialname rtspecialname

instance void .ctor(int32 _notuse) cil managed{ // Code size 32 (0x20) .maxstack 8 IL_0000: ldarg.0 IL_0001: ldstr "Hello Tom" IL_0006: stfld string ::name IL_000b: ldarg.0 IL_000c: call instance void [mscorlib]::.ctor() IL_0011: nop IL_0012: nop IL_0013: ldarg.0 IL_0014: ldstr "Hello Kitty" IL_0019: stfld string ::name IL_001e: nop IL_001f: ret} // end of method Cat::.ctor

.method public hidebysig specialname rtspecialname

instance void .ctor() cil managed{ // Code size 21 (0x15) .maxstack 8 IL_0000: ldarg.0 IL_0001: ldstr "Hello Tom" IL_0006: stfld string ::name IL_000b: ldarg.0 IL_000c: call instance void [mscorlib]::.ctor()

IL_0011: nop IL_0012: nop IL_0013: nop IL_0014: ret} // end of method Cat::.ctor


本文标签: 黄页 免费版 赋值 增加 全免费