G
Guest
I am a scientist who occasionally programs also in java (self-learning
on the Sun tutorials), and I'd like to know one thing about the "import"
statement which I haven't found clearly explained around.
Are import statements resolved at compile time (like C #include
directives or Fortran INCLUDE statements) ?
Or are they resolved at run time (like a reference to a library
subroutine, with CLASSPATH doing similarly to LD_LIBRARY_PATH for shared
libraries) ?
I find slightly painful to have to insert "the right list" of import
statements. Sometimes with wildcards (import javax.swing.*) and
sometimes explicitly (import javax.swing.table.AbstractTableModel), with
wildcards sort of not finding a subcomponent.
Will a class file compiled with lots of wildcard import be bigger or
less efficient than one with a few specific import ?
on the Sun tutorials), and I'd like to know one thing about the "import"
statement which I haven't found clearly explained around.
Are import statements resolved at compile time (like C #include
directives or Fortran INCLUDE statements) ?
Or are they resolved at run time (like a reference to a library
subroutine, with CLASSPATH doing similarly to LD_LIBRARY_PATH for shared
libraries) ?
I find slightly painful to have to insert "the right list" of import
statements. Sometimes with wildcards (import javax.swing.*) and
sometimes explicitly (import javax.swing.table.AbstractTableModel), with
wildcards sort of not finding a subcomponent.
Will a class file compiled with lots of wildcard import be bigger or
less efficient than one with a few specific import ?