![](https://img2022.cnblogs.com/blog/1582915/202209/1582915-20220923151908252-1375406140.png)
只需要把需要执行 的java 拖动到src文件 就可以执行了,不在期望的包里面
public class test{
public static void main(String[] args) {
AA c= new AA();
c.f(5) ;
System.out.println(c.f(5));
}
}
class AA{
public int f(int n) {
if (n==1) {
return 1;
}
else
return f(n-1)*n;
}
}