java: 无法将类 bit.minisys.minicc.myCCOMPILER中的方法 main应用到给定类型; 需要: java.lang.String[] 找到: 没有参数 原因: 实际参数列表和形式参数列表长度不同
时间: 2023-05-28 12:07:55 浏览: 85
这个错误提示表明在调用类 bit.minisys.minicc.myCCOMPILER 中的 main 方法时,传入的参数不符合方法定义中的形式参数列表。具体来说,main 方法应该接受一个字符串数组作为输入参数,但是实际传入的参数列表为空,因此出现了参数列表长度不同的错误。
要解决这个问题,需要在调用 main 方法时传入一个字符串数组参数,例如:
```
String[] args = {"arg1", "arg2"};
myCCOMPILER.main(args);
```
注意,args 数组中的元素可以根据实际情况进行修改,但是数组本身必须存在且不为空。
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pptx](https://img-home.csdnimg.cn/images/20210720083543.png)
![txt](https://img-home.csdnimg.cn/images/20210720083642.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![xlsx](https://img-home.csdnimg.cn/images/20210720083732.png)
![unitypackage](https://img-home.csdnimg.cn/images/20210720083646.png)