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.

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 2092
Rate it!


Answers:

Source: CoolInterview.com

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




Source: CoolInterview.com



Posted by: krishnasamy

Contact krishnasamy Contact krishnasamy

Source: CoolInterview.com

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

Source: CoolInterview.com



Posted by: Jk

Contact Jk Contact Jk

Source: CoolInterview.com

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.
Source: CoolInterview.com



Posted by: raseeka

Contact raseeka Contact raseeka

Source: CoolInterview.com

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.
Source: CoolInterview.com



Posted by: Prasana J

Contact Prasana J Contact Prasana J

Source: CoolInterview.com

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.
Source: CoolInterview.com



Posted by: Nageswara Rao

Contact Nageswara Rao Contact Nageswara Rao

Source: CoolInterview.com

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
Source: CoolInterview.com



Posted by: sunil

Contact sunil Contact sunil

Source: CoolInterview.com

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
Source: CoolInterview.com



Posted by: rajeshkumarreddy challa

Contact rajeshkumarreddy challa Contact rajeshkumarreddy challa

Source: CoolInterview.com

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
Source: CoolInterview.com



Posted by: Manjog Padhy

Contact Manjog Padhy Contact Manjog Padhy

Source: CoolInterview.com

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.

Source: CoolInterview.com



Posted by: tejaswini

Contact tejaswini Contact tejaswini

Source: CoolInterview.com

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
Source: CoolInterview.com



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
    India News Network

    Latest 20 Questions
    State the merits of Mergers and Acquisitions?
    What is the difference between Mergers and Acquisition?
    State the types of Merger?
    What is the meaning of Mergers?
    What is Price Limit in Futures and Options Trading Market?
    What is Price Discovery in Futures and Options Trading Market?
    What is Premium (options) in Futures and Options Trading Market?
    What is Premium (futures) in Futures and Options Trading Market?
    What is Premium in Futures and Options Trading Market?
    State the advantages of Foreign Collaboration?
    What is Position Trading in Futures and Options Trading Market?
    What is Position Limit in Futures and Options Trading Market?
    What is Position Day in Futures and Options Trading Market?
    What is Position in Futures and Options Trading Market?
    What are Point-and-Figure Charts in Futures and Options Trading Market?
    What is Pit in Futures and Options Trading Market?
    What is Performance Bond Margin in Futures and Options Trading Market?
    What is Performance Bond Call Program in Futures and Options Trading Market?
    What is Payment-In-Kind Program in Futures and Options Trading Market?
    What is the meaning of Foreign Collaboration?



    Fresher Jobs | Experienced Jobs | Government Jobs | Walkin Jobs | Company Profiles | Interview Questions | Placement Papers | Companies In India | Consultants In India | Colleges In India | Exams In India | Latest Results | Notifications In India | Call Centers In India | Training Institutes In India | Job Communities In India | Courses In India | Jobs by Keyskills | Jobs by Functional Areas

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

    Gate Articles | Gate Books | Gate Colleges | Gate Downloads | Gate Faqs | Gate Jobs | Gate News | Gate Sample Papers | Gate Training Institutes

    MBA Articles | MBA Books | MBA Case Studies | MBA Business Schools | MBA Current Affairs | MBA Downloads | MBA Events | MBA Notifications | MBA FAQs | MBA Jobs
    MBA Job Consultants | MBA News | MBA Results | MBA Courses | MBA Sample Papers | MBA Interview Questions | MBA Training Institutes

    GRE Articles | GRE Books | GRE Colleges | GRE Downloads | GRE Events | GRE FAQs | GRE News | GRE Training Institutes | GRE Sample Papers

    IAS Articles | IAS Books | IAS Current Affairs | IAS Downloads | IAS Events | IAS FAQs | IAS News | IAS Notifications | IAS UPSC Jobs | IAS Previous Question Papers
    IAS Results | IAS Sample Papers | IAS Interview Questions | IAS Training Institutes | IAS Toppers Interview

    SAP Articles | SAP Books | SAP Certifications | SAP Companies | SAP Study Materials | SAP Events | SAP FAQs | SAP Jobs | SAP Job Consultants
    SAP Links | SAP News | SAP Sample Papers | SAP Interview Questions | SAP Training Institutes |




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



    Cache = 0.007812 Seconds