chevron_left

Recent posts tagged inheritance

0 0 1 min.
**Problem:** ======== *Hi there! I have been learning to program for a long time now and I recently learned inheritance in Java. I wrote the following program for practice:* class Institutions { public void print_institutions() ...
posted Nov 21 Alecxe01 807 points
0 0 5 min.
Inspired by my parents coming to visit at the end of the week, I thought I’d write about how Perl classes can have “parents” as well, from which they inherit methods. Although it might seem on the surface as though [there’s more than one way to do it...
posted Nov 16 mjg 190 points
0 0 1 min.
**Problem:** ======== Hello all, Please explain to me the error in the following program. ​class test { String name="name"; public person(String nm){name=nm;} } class emp extends test { String empid="0000...
posted Oct 29 Naymul01 996 points
0 0 1 min.
Question: --------- My question was simple. I wanted to know that if I have two classes having a parent-child relationship and I call the parent class constructor in child class’s constructor. Now, I create an instance of the child class, whose cons...
posted Sep 19 john_dev 45 points
16 1 1 min.
Let us fill this blank and try to understand the concept you can use the keyword *super* to reference a method in the superclass from a subclass. The keyword *super* is related to Inheritance and is used in two different ways 1. To call a super c...
posted Sep 6 DivyaN 507 points
5 0 7 min.
Inheritance is an important pillar of OOP(Object-Oriented Programming). It is the mechanism in java by which one class is allowed to inherit the features(fields and methods) of another class. Important terminology: Super Class: The cla...
posted Aug 20 Yogesh Sharma 337 points
0 0 2 min.
One of the principles of object-oriented programming is Inheritance. Inheritance is the ability of one class to derive the properties and characteristics of another class. It allows creating hierarchical classifications. In C #, we can inherit f...
posted Aug 7 tanzimsiddiqee 21 points
1 0 1 min.
A C++ class can inherit members from more than one class and here is the extended syntax −class derived-class: access baseA, access baseB.... Where access is one of public, protected, or private and would be given for every ...
posted Aug 1 Yogesh Sharma 337 points
1 0 3 min.
Inheritance allows us to define a class in terms of another class, which makes it easier to create and maintain an application. This also provides an opportunity to reuse the code functionality and fast implementation time.When creating a class, inst...
posted Aug 1 Yogesh Sharma 337 points
6 0 3 min.
The implements and extends are two words that confuse many beginners when they start learning advanced programming in Java. Many beginners think these are used for the same purpose and can be used interchangeably, but this is not true. In this a...
posted Jul 31 Hafsa_Rao 390 points
11 0 2 min.
Genaralization and Specialization are the common topics in Java inheritance. By their names, generalization means the way to define generic classes and specialization means the way to define specific classes.Generalization and Specialization in JavaI...
posted Jul 4 mhfaisal 275 points
8 0 1 min.
In Java or any other object-oriented programming language, whenever there is a parent-child relationship between two classes, the parent’s constructor is always called when a child’s object is created. For example, consider the following ...
posted Jun 19 Hafsa_Rao 390 points
0 0 8 min.
​In object-oriented programming, it is no secret that we try to model every real-world instance into a class. And we know a class has a set of attributes and some methods. So basically, a class is like a common noun and an object refers to a single i...
posted May 15 cvsschaitanya 0 points
0 0 3 min.
Inheritance is the basis for object-oriented programming. It is used to increase usability and decrease the complexity of the code. It refers to deriving one or more classes from one class to inherit its properties and add more functionality to ...
posted Mar 21 Hafsa_Rao 390 points
6 0 1 min.
Templates Templates are a feature of the C++ that allows functions and classes to operate with generic types i.e, it will work for all types of data types. This allows a function or class to work on many different data types without being rewrit...
posted Apr 9, 2020 Lalit Kumar 0 points
6 0 1 min.
 If you are asking this question then most probably you can understand what is happening in code given below.class parent { public: void someFunction(string s){ }; }; class son : public parent { public: int someFunction(int i){}...
posted Apr 9, 2020 Lalit Kumar 0 points
To see more, click for the full list of questions or popular tags.