试试:
public class Test{
public static main(){
Test test = new Test();
RootTest rt = test.new RootTest();
rt.f1();
}
}//类RootTest.java
public class RootTest{
public void f1(){
}
}
public class Test{
public static main(){
Test test = new Test();
RootTest rt = test.new RootTest();
rt.f1();
}
}//类RootTest.java
public class RootTest{
public void f1(){
}
}
public static main(){
RootTest t=new RootTest();
t.f1();
}
}
就可以了
package test;
public class Test{
public static void main(String[] args){
RootTest.f1();
}
}//类RootTest.java
class RootTest{
public static void f1(){
System.out.println("sssss");
}
}可以的,f1是静态的