-7

I haven't been able to find a clear answer for this. Is there a definitive answer?

Quinn
  • 577
  • 2
  • 6
  • 14

2 Answers2

3

Short answer - no. If you're writing something that all methods are listed as abstract, consider an interface instead.

Long answer: In an abstract class you have the ability to have some methods be fully implemented (generally, methods you intend to share among extenders of the abstract class) and other methods that can be abstract to force extenders to implement them. All methods (abstract and implemented) can be freely referenced by all other methods as usual.

StormeHawke
  • 5,987
  • 5
  • 45
  • 73
1

Abstract classes don't have to have any abstract methods. You can have some or all methods as abstract. All methods of an interface are abstract whether you state this or not. If you implement an interface but don't define the methods, they are effectively abstract in the class even if you don't mention them in the abstract class.

e.g.

interface A {
     void method(); // implicitly abstract
}

abstract class B implements A {
     // B has one abstract method
}
Peter Lawrey
  • 525,659
  • 79
  • 751
  • 1,130