public class Sortee { public static void main(String[] args){ List x = new ArrayList(); x.add(5); x.add(new Integer(42)); x.add(new Integer(17)); x.add(Integer.parseInt("812")); sort(x); System.out.println(x); } }
In this java source.#1 use the static import to invoke sort() method. what's the reason. It's the first time saw static import.How to use static to modify package. If we change the #1 to: import java.util.Collections; What else should we do to make this java source run well? Thanks!
java exceptions may be runtime exception,a checked exception,a error. some exceptions throw by jvm,some throw by programmer. how to distingush different exception? how to deal with exceptions. please give a suggestion. Thank you.