Class : Inheritance✅ | Struct : Inheritance ❌

ozodbek_soft

Ozodbek

Posted on July 1, 2024

Class : Inheritance✅ | Struct : Inheritance ❌

Salom barchaga. Bugun biza 1 ta zo'r savolga javob topamiz
Savol: Nima uchun Classdan me'ros olish mumkinu, Structdan olib bo'lmaydi, Sabab ?

Buning turli xil sabablari bor, Bularni birmar bir ko'rib o'tib ketamiz!

Class
Class reference type hisoblangani uchun.
Class orqali Polymoqphismni qo'llab quvvatlash mumkin.

Struct
Structdan me'ros ola olmaslikning asosiy sababi bu Stack xotirada
saqlanishi, To'gri buni yaxshi tarafi ham bor. Ishlash yengillashadi

va tezlik oshadi. Ya'ni bekorga atyishmagan mashoyiqlar. Structni
faqatgina kichik joylardan ishaltinglar deb. Kattalarga ko'pgina
xususiyatlari ishlamaslik ehtimoli ham borda...

Xulosa: Tushunib oldingizmi ?

💖 💪 🙅 🚩
ozodbek_soft
Ozodbek

Posted on July 1, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related