OBJECT
Definition:
A class is like a blue print, which specifies what the type can do. An object is nothing but a block of memory, that has been configured and allocated according to the blue print.
- One program can create any number of objects.
- We can call objects as instances, because objects will store in an array or named variable or collection.
- A program can have multiple objects and interacting dynamically.
Example:
Here we are creating instance of A class in the B class. After that we are accessing A class properties after creating an object of A Class.
class A { public int i=0; public string strName=string.empty; } Class B { A obj=new A(); obj.i=30; obj.strName="ranga"; }
Post a Comment
Please give your valuable feedback on this post. You can submit any ASP.NET article here. We will post that article in this website by your name.