import static java.lang.Integer.*;
import static java.lang.Long.*;
public class StaticImortError {
public static void main(String args []) {
System.out.println(MAX_VALUE);
}
}
Can anybody please explain why this program is showing compile time error, if I tried to use imports like
import static java.lang.Integer.*;
import static java.lang.Long.MAX_VALUE;, it ran fine and as expected displayed the maximum value of long data types, but with the above imports its showing error.
staticfield namedMAX_VALUE. The compiler can't determine which one you want.*and.