Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私がアンボックス化を理解しているのは、MSDNの例のように、オブジェクトを取得してvaluetypeにアンボックス化するときです。
int i = 123; object o = i; o = 123; i = (int)o; // unboxing
だから私はちょうど考えていました、文字列を箱から出すことができますか?文字列を表すことができるvaluetypeがないため、できません。私は正しいですか?
あなたが正しい。ボックス化とボックス化解除の対象は値型のみであるため、文字列をボックス化解除することはできません。文字列は参照型です。