Skip to main content

Questions tagged [inheritance]

Inheritance is a way to reuse code of existing objects, or to establish a subtype from an existing object, or both, depending upon programming language support.

0 votes
2 answers
335 views

I have a question about setting up my service. My main concern is if the design is clean and in order. Whether it meets the SOLID principles and does not spill out on me. I have entities like order ...
Petr Klekner's user avatar
2 votes
3 answers
324 views

I have a Slide class with subclasses referring to the different types of slides (IntroSlide, SummarySlide, etc.): abstract class Slide { String slideType; final String title; final String ...
Hello's user avatar
  • 47
2 votes
3 answers
271 views

According to Why define a Java object using interface (e.g. Map) rather than implementation (HashMap), I know I should declare most abstract type when possible, for example, suppose I'm using an UI ...
wcminipgasker2023's user avatar
5 votes
2 answers
765 views

According to Is it bad practice to use Inheritance to associate methods with a basic container?, I know it is bad to inherit form std containers, mainly because std containers are not designed to be ...
wcminipgasker2023's user avatar
5 votes
4 answers
2k views

Let's say we have 2 (Java) classes: class A {} class B extends A {} To me, saying B extends A and B is dependent on A are both true (but not equivalent) in this situation. My colleague, OTOH, says ...
TheJavaGuy-Ivan Milosavljević's user avatar
2 votes
1 answer
398 views

When you define a class, is inheriting a logger such as log4cxx a good design? Assume I am defining a class called MyClass. When I want a logger, I use a pointer to an abstract logger class as a ...
Dhammika Wijesundera's user avatar
1 vote
4 answers
1k views

I know you can't inherit static methods, and it seems the consensus is that if you feel like you need to, you're doing something wrong. However, I don't know what the alternative is in my case. Please ...
Andrew's user avatar
  • 21
0 votes
5 answers
2k views

I have a base class "People" which two other classes inherit from: Employee and Student. The Student class includes a GPA (type double) and the Employee class does not. I have an ArrayList ...
Delta88's user avatar
  • 19

15 30 50 per page
1
2 3 4 5
39