0
Lets say i want to use methods of an abstract class, is there any way i can do it without overriding one of its methods ??
2 Respuestas
+ 3
You can do it from the sub class with the super keyword (or if it's protected just call it).
Or if the sub class doesn't actually override anything, then sure just call the method with an object of the same type as the super class.
+ 1
If the abstract class method was a public static method you should be able to invoke it without instantiation (and no subclass).
For example:
If MyAbstractClass had a public static method called methodA(), I can invoke it as:
MyAbstractClass.methodA()
No need to write a class that extends MyAbstractClass to get access to that method.