49.6k views
0 votes
Francis has created a new program. However, Francis used some objects from another program to run methods in the current program. What is the feature of OOP called ?

User R P
by
3.7k points

2 Answers

5 votes

Answer:

Code reuse

Step-by-step explanation:

User Vili
by
3.5k points
4 votes

Answer:

This is inheritance. Suppose there is a python program p1.py with class Person

And we want to use the method in Person in another program p2.py

We can import that class in p2 like

from p1 import Person

And now we can create an object of class Person in p2 and use any of the methods inside the Person.

The same thing can be done in c++. java, c#, swift and various other OOPS based programming languages.

Step-by-step explanation:

Please check the answer section.

User Arup Rakshit
by
3.7k points