5 May 2013

Class, Object

Class
Class defines the attributes and behavior used by all instance of class.
for ex
Class name : Car
Attributes [Properties] : Color, Speed 
Behavior [Methods] : Accelerate, Turn and Brake

No memory is allocated when class is created.
Default access specifier for class is Private.
Class is a reference type, so when call the class by creating the object memory is allocated on the heap.

Object
An Object is an instance of class.
Object have individual copies of attributes and share a common set of behavior.
for ex


Class name : Car
Attributes [Properties] : Color, Speed 
Behavior [Methods] : Accelerate, Turn and Brake



Object is creating using new keyword.

No comments:

Post a Comment

Comments Welcome

Implementing OAuth validation in a Web API

 I mplementing OAuth validation in a Web API Implementing OAuth validation in a Web API using C# typically involves several key steps to sec...