CoolInterview.com - World's Largest Collection of Interview Questions & Answers, FAQs, queries, sample papers, exam papers, dumps, what, why, how, where, when questions
Interview Success Kit - Get Success in Job Interviews Interview Success Kit - 30,000 Interview Que. & Ans.
Covers 30,000+ Interview Questions asked in actual MNC Interviews - all with model answers.
Get Your Dream Job Now - www.vyoms.com
Sponsored Links
Interview Questions
Our Services

INTERVIEW QUESTIONS MICROSOFT C# DETAILS
Question :
Real life examples of polymorphisms, encapsulation and inheritance?

Posted by: CRP on 6/19/2013

Contact CRP Contact CRP
Category C# Interview Questions
Rating (3.5) By 73 users
Added on 6/19/2013
Views 2047
Rate it!
Answers:

polymorphisms:-
polymorphisms is nothing but ability to take more than one forms(One Interface,Multiple Methods or One Name,Many Forms).

Encapsulation:-
-is nothing but wrapping the data and functions into single entity.

Inheritance:-
The Process of deriving new class from existing class.This is called Inheritance.
New Class-Child Class
Existing Class-Parent Class

Types:
*Single Inheritance
*Multiple
*Hybrid
*Multilevel
*Hierarchical





Posted by: krishnasamy

Contact krishnasamy Contact krishnasamy

Hey, It asks for real world examples...

Polymorphism:

say a door..
a door to a temple, a door to a house, a door to a kitty house,
all are doors, but all look different

Encapsultion:

cars and owners...
all the functions of cars are encapsulated with the owners..
No one else can access it...


Inheritence:

Kingfisher jet
^
|
Airplane
^
|
Flying Things



Posted by: Jk

Contact Jk Contact Jk

polymophism ...good example is when dog smells a cat it will barkand run after it but when it smells food it it will salivate and run to its bowl.ie .sence of smell is at work in both situations but action depends upon what it smells.



Posted by: raseeka

Contact raseeka Contact raseeka

polymorphism:
Poly = many
morphs = forms
existing in many forms.
It is achieved by OVERLOADING and OVERRIDING.

EXAMPLE: We behave diffrently in front of elders, and friends.
a single person is behaving diffrently at diffrent time.

ENCAPSULATION:
Wrapping up data and member functions in a single unit for easier and safer access.

INHERITANCE:
A new class(child) can be based on existing class(parent) deriving functionallity from parent class.



Posted by: Prasana J

Contact Prasana J Contact Prasana J

Polymorphisam: An Object is in different forms and in each form its exhibit the same functionality but the implementation is different.

Eg: A Person who knows more than two languages he can speak in a language which he knows. Here person is Object and speak is polymorphisam.

Inheritance: The process of eqiring the existing functionality of parent and with new added features and functionality of a child Object.

A secintific calculator is a extend form of Caluculator here Caluculator is parent and secintific calculator is Child object.

Encapsulation: Binding of data and behavior i.e functionality of an object in a secured and controlled manner.



Posted by: Nageswara Rao

Contact Nageswara Rao Contact Nageswara Rao

real life exam :
polymorphisam.it is phenominal used for one interface multiple function. girl like a friend,girlfiriend,daughter
inhertance.it is a property in which derived class inherits feauters of base class.like father and son
encapsulation.encapsule only relevent information.line vaccum cleaner



Posted by: sunil

Contact sunil Contact sunil

IT IS REALLY GOOD QUESTION

POLYMORPHISAM MEANS HAVE SAME FORMS WITH DIFFERENT METHODS

EXAMPLE MAN EAT FOOD, MAN DRINK WATER.

HERE MAN IS THE FORM HAVING WITH SAME NAME
FOOD AND WATER IS THE METHODS


ENCAPSULATION MEANS HIDING ALL THE INTERNAL DETAILS OF THE METHODS.

EXAMPLE cars and owners...
all the functions of cars are encapsulated with the owners..
No one else can access it...

INHERITANCE MEANS A CHILD CLASS USE THE ALL THE ELEMENTS IN THE PARENTS CLASS.

DAD
||
CHILED



Posted by: rajeshkumarreddy challa

Contact rajeshkumarreddy challa Contact rajeshkumarreddy challa

EX OF POLYMORPHISM:
A TEACHER BEHAVES TO STUDENTS
A TEACHER BEHAVES TO HIS/HER SENIORS
HERE TEACHER IS AN OBJECT BUT ATTITUDE IS DIFFERENT IN DIFFERENT SITUATIONS



Posted by: Manjog Padhy

Contact Manjog Padhy Contact Manjog Padhy

polymorphism: poly=many
morphism=forms
i.e one interface having many methods.
human being
encapsulation: hiding the information of essential detalis.
inheritance: the process of deriving one class from parent class.



Posted by: tejaswini

Contact tejaswini Contact tejaswini

Polymorphism means ability to take more than one form thats an operation can exhibit different behavior at different instance depend upon the data passed in the operation
the real life example
A software engineer can perform different task at different instance of time depending on the task assign to him
he can done coding , testing , analysis and designing depending on the task assign and the requirement



Posted by: Deepesh Yadav

Contact Deepesh Yadav Contact Deepesh Yadav

If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-

  • There should not be any Spelling Mistakes.
  • There should not be any Gramatical Errors.
  • Answers must not contain any bad words.
  • Answers should not be the repeat of same answer, already approved.
  • Answer should be complete in itself.
  • Name :*
    Email Id :*
    Answer :*
    Verification Code Code Image - Please contact webmaster if you have problems seeing this image code Not readable? Load New Code
    Process Verification Enter the above shown code: *
    Inform me about updated answers to this question

    Related Questions
    View Answer
    What is partial class. & what is advantage.
    View Answer
    What is the name of c#.net compiler?
    View Answer
    What is an object?Define a class.
    View Answer
    Define abstraction,encapsulation,inheritance:with example.
    View Answer
    Define abstraction,encapsulation,inheritance:with example.
    View Answer
    What is mean "Death of Diamod"?
    View Answer
    what is the main difference between delegate and an event in c#?
    View Answer
    How to use HASH TABLE,ARRAYLIST in c# explain with example?
    View Answer
    Assemblies are of the following types:

    View Answer
    What is the difference between shadow and override

    View Answer
    What is the top .NET class that everything is derived from?

    View Answer
    C# provides a default constructor for me. I write a constructor that takes a string as a parameter, but want to keep the no parameter one. How many constructors should I write?

    View Answer

    Please Note: We keep on updating better answers to this site. In case you are looking for Jobs, Pls Click Here Vyoms.com - Best Freshers & Experienced Jobs Website.

    View ALL C# Interview Questions & Answers

    User Options
    Latest 20 Questions
    How to Retrieve a Cookie Value ?
    How to Create a Cookie?
    What is ViewState ?
    What are different methods of session maintenance in ASP.NET?
    What is cross cutting concern and concern in spring AOP ?
    What are the important beans lifecycle methods ?
    Explain the advantages of using DAO module?
    What is SQLProvider ?
    How struts application can be integrated with spring?
    What are the advantages of spring framework?
    What is ?Throws advice? in Spring ?
    What is Metadata Autoproxying ?
    Describe about DAO in Spring framework ?
    What is called an Advice ?
    What is IOC?
    What are the types of Dependency Injection?
    What are the different Modes of Autowiring ?
    Define Application context module?
    Why Spring framework is needed?
    What is called Spring MVC?


    Copyright ©2003-2016 CoolInterview.com, All Rights Reserved.
    Privacy Policy | Terms and Conditions

    Download Yahoo Messenger | Placement Papers| FREE SMS | ASP .Net Tutorial | Web Hosting | Dedicated Servers | C Interview Questions & Answers

    Testing Articles | Testing Books | Testing Certifications | Testing FAQs | Testing Downloads | Testing Interview Questions | Testing Jobs | Testing Training Institutes


    Cache = 0 Seconds