public class test {
int[] acount(int m, int n){
int x,y,z;
int i = 0;
int result[] = new int[9];
for (x = 0; x < 9; x++)
{for (y = 0 ; y < 9 ;y++){
for (z = 0; z < 9; z++){
if (x + y == m){
if (y + z == n){
result[i] = x;
i ++;
}
} }
}
}
return result;
}
public static void main(int[] args){
int output[];
test test1 = new test();
output = test1.acount(args[0],args[1]);
for (int a = 0; a < output.length; a++){
System.out.println(output[a]);
}
}
}执行的时候报Exception in thread "main" java.lang.NoSuchMethodError: main
int[] acount(int m, int n){
int x,y,z;
int i = 0;
int result[] = new int[9];
for (x = 0; x < 9; x++)
{for (y = 0 ; y < 9 ;y++){
for (z = 0; z < 9; z++){
if (x + y == m){
if (y + z == n){
result[i] = x;
i ++;
}
} }
}
}
return result;
}
public static void main(int[] args){
int output[];
test test1 = new test();
output = test1.acount(args[0],args[1]);
for (int a = 0; a < output.length; a++){
System.out.println(output[a]);
}
}
}执行的时候报Exception in thread "main" java.lang.NoSuchMethodError: main
解决方案 »
- java或计算机的最小单位是字节吗
- 如何实现URL通信
- java.net.SocketException: Connection timed out
- 一道关于泛型的小问题
- 求教关于servlet中timer.cancel()的使用问题,在线等
- 为什么我的java编译器javac.exe打不开?
- 弱弱问一个问题
- 一个数学问题,编程解决,求!也看看大家的数学能力!
- 初学JB,那位兄弟给我说一下DATABASE,TABLEDATASET,QUERYDATASET的常用方法和属性,谢谢!
- 怎么在java里调用一个oracle的procedure呢?
- 求助!applet在jb里好好的,加到网页里不响应按钮事件?
- 我的环境设置
public static void main(String[] args) 才对阿
应该这样定义
public static void main(String[] args)
或着
public static void main(String args[])
然后
output = test1.acount(args[0],args[1]); 改成
output = test1.acount(Integer.parseInt(args[0]), Integer.parseInt(args[1]));