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 - 9,000 Interview Que. & Ans.
Covers 9,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 (0.3) By 73 users
Added on 6/19/2013
Views 2012
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

    User Options
    Latest 20 Questions
    what is business process service? explain
    what is business process service? explain
    why we use normal brain in object identification when we have smart brain?
    what should the 64-bit integer type on new,64-bit machines be?
    What is the meaning Of Accounting
    How can u create apache log files with name as date?(means every day it has to create new log file with name as date) not by any scripts..
    How can u schedule a job using cron for 20 secs?
    Find about the weight and measure used in past?
    What is the difference between filter and condition? clear definition?
    How to write functions in c program without using headerfile.
    What is the script for retrieving data which is of string type from excel sheet.
    what are the interview questions in unix through informatica?
    1)what are all Unix commands we are using in informatica?
    How to pass multiple tables in datasets simultaneously?
    How abstraction done in C?
    you don't have enough experience, in fact you were ideal for one year, give any one reason to select you in our prestigious institution for the course of mba
    what do they mean by account payable
    'Describe for me a situation where you were required to gather a large amount of data, to analyse it objectively and to make a decision or a recommendation based on the results.'
    Can we add different work flows in to one batch and run sequentially? If pos how do we do that?
    what is studs and test drivers? it is related to testing?


    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