Monday, October 8, 2018

Java static Method import

this was interesting to see the method is directly imported. This is possible for variables and functions those are static.

import static com.github.florent37.materialviewpager.Utils.canScroll;
import static com.github.florent37.materialviewpager.Utils.colorWithAlpha;
import static com.github.florent37.materialviewpager.Utils.dpToPx;
import static com.github.florent37.materialviewpager.Utils.getTheVisibileView;
import static com.github.florent37.materialviewpager.Utils.minMax;

However, there seems to be no performance impact or advantage due to this

references:
https://stackoverflow.com/questions/18825640/are-there-any-advantages-of-using-static-import-over-import

No comments:

Post a Comment