I am developing with GWT and sharing the codebase with an Android developer. Some functions that we want to separate take certain arguments, such as "Drawable" for Android and "Image" for GWT.
Is it possible to use a preprocessor variable, as in C ++:
#ifdef ANDROID
public void DrawImg(Drawable img);
#elif GWT
public void DrawImg(Image img);
#endif
The solution we are testing is general:
interface DrawImgInterf<T extends Object> {
public void DrawImg(T img);
}
However, using a preprocessor variable seems better. Is there such a thing in Java?
source
share