statisches Mitglied in Java

package pack1;

public class A {
    public static int i = 10;

    public static void test()  {
    System.out.println("done");
    }

 }



//this is other .class file
package pack2;
import static pack1.A;  
import static java.lang.System.out;
public class Manager2 {
  public static void main(String[] args) {
           out.println(i);
           test();
  }
}

Wann immer ich benutzeimport static pack1.A; wie ich in der klasse manager2 anstatt verwendet habeimport static pack1.A.*;zeigt der Compiler einen Fehler. Nichtimport static pack1.A; Importklasse A inklusive statischer Member?

Ich bin mir dessen bewusstimport static pack1.A.i importiert statische Elemente, aber 'import static pack1.A;' zeigt einen Fehler an.

Antworten auf die Frage(1)

Ihre Antwort auf die Frage