DEV Community

fazliddin
fazliddin

Posted on

ValueType and ReferenceType

a)Value Type — bu qiymatning o'zi bilan ishlaydigan tiplar bo'lib, ular stack xotirasida saqlanadi. Bu turlar bevosita o'z qiymatini saqlaydi va boshqa o'zgaruvchiga qiymat o'rnatilganda, qiymat nusxasi o'tkaziladi.

Reference Type qiymatni o'zi bilan emas, balki qiymatni saqlagan joyga ishora bilan ishlaydi. Bunday turlar heap xotirasida saqlanadi, o'zgaruvchining qiymati esa stackda ishorani saqlaydi.

b)2-ta o'zgaruvchini yaratamiz a va b. a-ni 5-ga tenglaymiz, b-ni esa a-ga tenglaymiz. Keyin esa b-ni 10-ga tenglaymiz va Console-ga a-ni chiqazamiz.

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay