Tuesday 25 April 2017

Lecture#2 ka Point#71 (Csharp Roman Hindi/Urdu Me).

Jo cheez "curly brackets{}" k dermiyan mojood hogi to yeh is cheez ka scope kehlaye ga.



Agar kisi variable ka scope class k kisi function ya constructor me define na ho ya class k ander root pe hi varriable define ho to woh humare pass "Instance variable" kehlaye ga.




Variable declarationStudent Haroon;


Variable initializationStudent Haroon = new Student();

Instance variable ko hum class-level variable bhi kehtey hain.


Student Haroon = new Student(); me Haroon naam ka variable memory me declare ya define ho jata hai jis ki data type ya class Student hai lakin yeh variable memory me tb tak exists nahi kre ga jab tak hum is variable ko new k keyword k sath initialize na krwa le.



.NET Framework me hum jab bhi koi program bna rhey hongey to aik "memory pool area" hoga jo humare program k liye reserve ho jaye ga aur jitne bhi instances ya objects hongey memory me woh is "memory pool area" me initialize hongey.



Program ka "memory pool area" alag hota hai aur variables ka "memory pool area" alag hota hai.



C#(C sharp) me agar hum kisi cheez k sath access modifier nahi likhtey to woh cheez by-default "Private" hogi jab k VB.NET me agar hum kisi cheez k sath access modifier nahi likhtey to woh cheez by-default "Public" hogi.



VB.NET is slightly "loosly coupled system".



Agar humney apne instance variable ko declare to kiya lakin initialize nahi kiya to by-default woh instance variable apni default value se initialize ho jaye ga. FOR EXAMPLE: byte b; me "b" instance variable hai aur is ki data type "byte" hai aur "byte" data type ki default value "0" hai to is ka matlab yeh hua k byte b = 0; .



Hr data type k by-default tamam bits us waqt tk "OFF" ya "0" hotey hain jab tk us data type ka variable initialize nahi ho jata.

No comments:

Post a Comment