in http://source.android.com/source/code-style.html
I read about use fully qualify imports. But I am curious about the negative affects of not using imports explicitly. For instance, if I use the following code
package blabla;
import foo.*;
import hee.*;
import lee.*;
...
...
public class ImportKing {
...
}
from my understanding, when this class--ImportKing is used anywhere in the project, the classloader will load any classes it imported, therefore will consume extra system memory for needless imports.
testing code:
//import java.*;
public class ImportKing {
public static void main(String[] args) {
while(true) {
System.out.println("running");
}
}
}
testing result:
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
shanwu 3316 39.8 0.6 3182012 52196 pts/0 Sl+ 09:25 0:03 java ImportKing with extra imports
shanwu 3440 43.7 0.6 3182012 52752 pts/0 Sl+ 09:27 0:03 java ImportKing without extra imports
I didn't see any negative effects on program performance for extra imports. Is extra imports handled by java compiler, so we don't have problem like wasting system memory?