Académique Documents
Professionnel Documents
Culture Documents
For More Details on .Net Interview Questions and Answers Please visit :
http://www.questpond.com
An object is a software bundle of variables and related methods. Objects are related
to real life scenario. Class is the general thing and object is the specialization of
general thingObjects is instance of classes.
• Attribute
• Behavior
• Identity
• This identity is usually created using an identifier which is derived from the
type of item
• Encapsulation is the ability to hide its data and methods from outside the
world and only expose data and methods that are required
• Encapsulation is a protective barrier that prevents the code and data being
randomly accessed by other code or by outside the class
• Encapsulation gives you the ability to validate the values before the object
user change or obtain the value
2. Using properties
Benefits of Encapsulation
• A class can change data type of its fields anytime but users of this class do
not need to change any code
• Inheritance enables you to create new classes that reuse, extend, and modify
the behavior that is defined in other classes
• The Class whose methods and variables are defined is called super class or
base class
• The Class that inherits methods and variables are defined is called sub class
or derived class
• Sometimes base class known as generalized class and derived class known
as specialized class
• Code are easy to manage and divided into parent and child classes
• Poly means many and morph means form. Thus, polymorphism refers to
being able to use many forms of a type without regard to the details
Types of Polymorphism
• Method overloading means having two or more methods with the same name
but with different signatures
• Method overriding means having two or more methods with the same name ,
same signature but with different implementation
• Private
• Protected
• Internal
• Protected internal
• Public