Tuesday 25 July 2017

Lecture#3 ka Point#83 (Csharp Roman Hindi/Urdu Me).

Jitni bhi primitive data types hain, they are structures. Structures aik aur tarika kaar hai data types ko represent krne ka.



Class aik tarika kaar hai data type bnaney ka. Classes k instances Heap me jatey hain. Heap is basically large memory pool area.



Structures k instances woh Stack me jatey hain. Stack is basically small memory pool area.



Stack pe FIFO method hota hai jab k Heap pe memory Traverse hoti hai.



Classes Heap pe jati hain isi liye hum classes k instances ko new k keyword se initialize krtey hain.



Stack pe humey memory space allocate krwane ki zaroorat nahi hai kyun k motherboard k upper jo register hain that is Stack.



Aik hi program k andar hum aik naam k 2 instances ya objects nahi bna saktey.



Aik hi naam k aik se zyada constructors with different signatures aur hi class me hon to isey hum constructor overloading kahen ge. Constructor overloading bilkul function overloading ki tarha hogi.




Example
class Arithmetic{
Public Arithmetic(){
height = 1;
}
Public Arithmetic(int height){ //parameter height is a local variable
this.height = height; //this.height is an instance variable & height is a local variable
}
private int height; //height is an instance variable
}

No comments:

Post a Comment