DEV Community

System32 Woffie
System32 Woffie

Posted on

Autoboxing နဲ့ Unboxing ဆိုတာ

Autoboxing ဆိုတာ primitive types များဖြစ်ကြတဲ့ boolean, byte, char, float, long, int, short, double တွေကို Wrapper class များဖြစ်ကြတဲ့ Boolean, Byte, Char, Float, Long, Integer, Short, Double အဖြစ်ပြောင်းလဲပေးခြင်း ဖြစ်တယ်။

အရှင်းဆုံးပြောရရင် primirtive types တွေကို object အဖြစ် သုံးလို့ရအောင် Wrapper Class တီထွင်လိုက်တာဖြစ်တယ်။ သူမှာလည်း သက်ဆိုင်ရာ methods တွေ အပို ပါဝင်လာပါတယ်။
image

Unboxing ဆိုတာက Object ဖြစ်နေတဲ့ တန်းဖိုးတွေကို primitive types အဖြစ် ပြန်ပြောင်းတဲ့ ဖြစ်စဥ်ကို ဆိုလိုတာ။

မေးခွန်း Object နဲ့ Primitive Types တွေက Memory ပေါ်မှာ ဘယ်လို အလုပ်လုပ်လဲ? Space ဘယ်လောက်ယူလဲ?

Top comments (0)