java - Abstract class or interface for translator objects on Android -
I want to summarize the translator service for the user. I have the idea of doing this in two ways:
or interface with this method:
public null translation (T basic, T1 source);
Or an abstract class with the same method, with generic classes to use with both classes.
Its better, interface or intangible class witch?
How can I do this in Android with normal classes? Because the compiler says that
symbol can not be solved
I hope that I understand correctly Generic parameter should appear in the Interface (or Abstract Class) Declaration:
Whether an abstract class or an interface is more suitable, it depends on the fact that the interface (or sub-classes of the abstract class) can be seen as an implementation Is similar to the interface / abstract class or not. If the answer is yes, then an abstract class is appropriate.
Comments
Post a Comment