Java: a compressed way to import multiple constants

Is there a compressed import method in Java that would be equivalent to the following expression:

import static android.view.View.GONE;
import static android.view.View.INVISIBLE; 
import static android.view.View.VISIBLE;

I know about it:

import android.view.View.*;

But I would like to be able to control what I import, and not just import everything into the View namespace.

ANSWER: Answer No.

+3
source share
1 answer

No, there is no faster way to just import some constants. You can get them all, or you can list each one that you want separately.


In fact, there is technically the third option, and not that it is necessarily better. You have the opportunity to import none of them and use their full name each time you access them.

+8
source

All Articles