answersLogoWhite

0

What is inheritance in oops?

Updated: 8/10/2023
User Avatar

Wiki User

12y ago

Best Answer

Inheritance is a process of inheriting members and member functions of a particular class. This means one class can use the data members and functions of another similar class. This reduces efforts as similar data members or functions do not need to be declared again and again.

User Avatar

Wiki User

16y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

15y ago

Inheritance is an object oriented feature supported by Java wherein the features of one Java class can be inherited/made available in another class. This creates a parent child relationship between these 2 classes. Class Inheritance in java mechanism is used to build new classes from existing classes. The inheritance relationship is transitive: if class x extends class y, then a class z, which extends class x, will also inherit from class y. Object-oriented programming allows classes to inherit commonly used state and behavior from other classes. Example: public class Parent { private String name = "Rocky"; public String getName(){ return this.name; } } public class Child extends Parent { public static void main(String[] args){ System.out.println("Name in Parent is: " + getName()); } } Here the getName() method is available only in the parent class but is directly used in the child class because the method is public and is directly accessible to the child class since it has extended the parent class.

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

C++ strongly supports the concept of reusability .

The mechanism of deriving a new class from an old one is called as inheritance(or derivation). The old one is called as the base class and the new one is called as the derived class or subclass.

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

Inheritance is a Object Oriented concept wherein one class can inherit/extend/reuse the features of its parent.

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

Yes. It creates two types of relationships known as "IS-A" and "HAS-A"

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is inheritance in oops?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What are the characteristics of OOPS?

Data Encapsulation, Abstraction, Inheritance, Polymorphism


What is single inheritance in oops?

Single Inheritance is the concept of deriving a class properties from a single base class


What is a synonymm for oops?

OOPS refers to Object Oriented Programming Structure. Some common terms used in oops are # Inheritance # Polymorphism # Encapsulation # Data hiding etc..


Examples for oops concepts?

polymorphism,inheritance,encapsulation,objects,classes


Does java support oops concept?

Yes. Java is an Object Oriented Programming Language and it supports the OOPS concepts like Inheritance, Polymorphism etc


What is oops.explain briefly the elements of oops?

if any system supports for abstraction,encapsulation,inheritance and polymorphism.


Is cpp complete oops?

No, C++ is not a strict OOP language as like Java and C#. C++ supports all OOPS concept like Encapsulation, Polymorphism, Inheritance etc. But C++ provides a way to expose the private data to outside world using friend functions, which is a violation of OOPS.


Main deffrent between c and cpp?

The main difference between c and c++ is the concept of 'Object Oriented Programming' (OOPS). Thus c does not have the benefits of oops like: 1. abstraction 2. encapsulation 3. inheritance 4. polymorphism etc.


Oops you will smile?

oops, i rather not.


What are the four basic principles of object oriented programming language?

The four basic principles of OOPs are 1...class and object..2...Encapsulations(Data hiding)..3...Inheritance..4...Polymorphism...


What is a four letter word for oops?

oops


What is full form oops?

Oops ! I did it again.