Questions tagged [concreteclass]

34 questions
0
votes
1 answer

Finding out concrete implementation from superclass

I'm trying to refactor parts of a large codebase and am at a point where the code resembles - abstract class Animal { String type; } class Dog extends Animal { public Dog() { type = "DOG"; } } class Cat extends Animal { public Cat() {…
adskuser
  • 19
  • 4
0
votes
2 answers

Abstract class vs Concrete class?

I am learning Object Oriented Programming, but I am confused about abstract class and concrete class. Some real world examples would be appreciated. And what are benefits of using one over another? When would one prefer abstract class and concrete…
Bhushan Lodha
  • 6,824
  • 7
  • 62
  • 100
-1
votes
2 answers

Abstract and concrete classes - getters and setters

How can I use setters in the concrete class? I have two abstract classes and the bottom concrete class should be able to set all the private variables I have the abstract classes, how can I do that? I could just add getters and setters in my…
axis93
  • 17
  • 4
-1
votes
2 answers

Constructor allowed in abstract class but not in Interface

Correct me , if I am wrong The above title draw me close to the following conclusions : 1) Constructor is , nothing else , but a concrete method with class name and no return type , not even void . 2) And , abstract class can have both concrete and…
1 2
3