|
INTERVIEW QUESTIONS
CONCEPTS AND ARCHITECTURE
OOPS
DETAILS
Question: What Is Inheritance?
Answer: Different kinds of objects often have a certain amount in common with each other. Mountain bikes, road bikes, and tandem bikes, for example, all share the characteristics of bicycles (current speed, current pedal cadence, current gear). Yet each also defines additional features that make them different: tandem bicycles have two seats and two sets of handlebars; road bikes have drop handlebars; some mountain bikes have an additional chain ring, giving them a lower gear ratio.
Object-oriented programming allows classes to inherit commonly used state and behavior from other classes. In this example, Bicycle now becomes the superclass of MountainBike, RoadBike, and TandemBike. In the Java programming language, each class is allowed to have one direct superclass, and each superclass has the potential for an unlimited number of subclasses:
|
|
|
Category |
OOPS Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.2) By 6833 users |
Added on |
8/26/2014 |
Views |
71540 |
Rate it! |
|
|
Question:
What Is Inheritance?
Answer:
Different kinds of objects often have a certain amount in common with each other. Mountain bikes, road bikes, and tandem bikes, for example, all share the characteristics of bicycles (current speed, current pedal cadence, current gear). Yet each also defines additional features that make them different: tandem bicycles have two seats and two sets of handlebars; road bikes have drop handlebars; some mountain bikes have an additional chain ring, giving them a lower gear ratio.
Object-oriented programming allows classes to inherit commonly used state and behavior from other classes. In this example, Bicycle now becomes the superclass of MountainBike, RoadBike, and TandemBike. In the Java programming language, each class is allowed to have one direct superclass, and each superclass has the potential for an unlimited number of subclasses: Source: CoolInterview.com
Acquire the property of one class to another class;i.e. base class to derived class.. Source: CoolInterview.com
Answered by: rajendra | Date: 8/5/2010
| Contact rajendra
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.
|
|
Related Questions |
View Answer |
|
What Is a Class?
|
View Answer
|
|
Explain about a class?
|
View Answer
|
|
Explain about the Design Phase?
|
View Answer
|
|
Explain the implementation phase with respect to OOP?
|
View Answer
|
|
Explain what is an object?
|
View Answer
|
|
Explain about Object oriented programming?
|
View Answer
|
|
Explain the rationale behind Object Oriented concepts?
|
View Answer
|
|
How object oriented concept is implemented in cell phone?
|
View Answer
|
|
How is memory allocated by new ? a) In a heap b) in a stack b) both a & b c) None of these.
|
View Answer
|
|
How to implement the runtime polymorphism using c++. examples.
|
View Answer
|
|
Can we inherit private members of class ?
|
View Answer
|
|
Explain the Inheritance principle
|
View Answer
|
|
What is OOPS?
|
View Answer
|
|
Describe the principles of OOPS
|
View Answer
|
|
Explain the Encapsulation principle
|
View Answer
|
|
Explain the different forms of Polymorphism.
|
View Answer
|
|
Explain the Polymorphism principle.
|
View Answer
|
|
What is the use/advantage of function overloading
|
View Answer
|
|
while copying the objects if you say X a = b and asssume that '=' operator is overloaded then what it will call, a copy constructor or operator overloading function
|
View Answer
|
|
What is the difference between encapsulation and datahiding.explain with example
|
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 OOPS Interview Questions & Answers - Exam Mode /
Learning Mode
|