-1

Currently, I have this code to create a base class with methods for their children classes. But I haven't declared any abstract classes. Is it a Java practice?

Unheilig
  • 16,196
  • 193
  • 68
  • 98
klasmeytmo
  • 49
  • 1
  • Use abstract class when u have common methods which will be used in the sub classes and you never want anyone to create an object of the this class. – Rahul Thachilath Apr 23 '15 at 07:07

1 Answers1

0

It depends on your requirement. If you intend to write the base class only for getting extended you can declare it abstract. An abstract class provides you a default behaviour otherwise you can also write an interface if you only need to declare methods.

underdog
  • 4,447
  • 9
  • 44
  • 89