DEV Community

Sunnat Qayumov
Sunnat Qayumov

Posted on

4 4 4 4 4

4. Value Type va Reference Type

a) Value Type va Reference Type nima?

Value Type — bu qiymatning o'zi bilan ishlaydigan tiplar bo'lib, ular stack xotirasida saqlanadi.

Reference Type - qiymatni o'zi bilan emas, balki qiymatni saqlagan joyga ishora (reference) bilan ishlaydi. Bunday turlar heap xotirasida saqlanadi.

*b) Quyidagi kodni tushuntiring: *

int a = 5;
int b = a;
b = 10;
Console.WriteLine(a);
Enter fullscreen mode Exit fullscreen mode

int tipida a nomli o'zgaruvchi yaratamiz va uni 5 ga tenglaymiz. int tipida yana b nomli o'zgaruvchi yaratamiz va uni a ga tenglaymiz. b ga yangi qiymat beramiz. Console.WriteLine() orqalia ni chop etamiz.

Top comments (1)

Collapse
 
asilbek_ibragimov_a0c27cc profile image
asilbek ibragimov

боларкану 5 бахо

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay