C# fundamentals

                                C# Fundamentals

Well comming back to c# todays post is about to clear the concept about the basic of c# that is about the class and data members 

OOPS concepts for c#:-
  • All data members are allocated  in heap.
  • The refrence of the object we create are stored in Stack.
  • To declare the object and to instantiate are two different things 

 By just declaring the object dosent make the utilization of memory that is no class variables are          allocated in heap. Just by declaring the object we are creating the refrence .

      i.e if we have class abc than,

abc a; dosent make the members occupy memory in heap, But by abc a=new abc(); this gives instantiation to object what this statement actually means..?  This statement means that by writing new keyword we instantiate the object and it takes the refrence of object if we have declared a constructor or any class, object refrence is  stored in this variable and making them initialize comes back and the refrence is allocated in stack.

  • Now commig on to constructor we know already what is constrctor all know we have to look in c# or we can take the data member or functions all the constructor function and data members we take are not accessible outside the class so what it means....???
  • Yes they are defaulty private so make them public if you want to access .

      


Comments

Popular posts from this blog

State space search / blocks world problem by heuristic approach /TIC TAC TOE

Navigation in Vaadin.

Drag and drop items from one Grid to another