//在main()函数前加static关键字,如下:
java.lang.NoSuchMethodError: main . public class keyi
{
int order,d, b1=2,b2=6,b3=24; String output="",
a1="very good",
a2="much better",
a3="the best",
a="it's ",
word;
public void keyi ()
{ } public void methods (int e)
{
switch (e)
{
case 1:word=a+a1;
output+=word;
break ; case 2:word=a+a2;
output+=word;
break; case 3:word=a+a3;
output+=word;
break;
} return;
}public int method (int b) {
int y;
if (b%6==0)
if(b%8==0)
y=3;
else y=2;
else
y=1; return y;
}public static void main ( String [] args){ order=1+(int)((Math.random())*3); switch(order)
{
case 1:
d=method(b1);
methods(d);
break; case 2:
d=method(b2);
methods(d);
break; case 3:
d=method(b3);
methods(d);
break;
} System.out.println("please press the key enter\r");
System.out.println("hello,"+output);
System.exit(0); }
}
java.lang.NoSuchMethodError: main . public class keyi
{
int order,d, b1=2,b2=6,b3=24; String output="",
a1="very good",
a2="much better",
a3="the best",
a="it's ",
word;
public void keyi ()
{ } public void methods (int e)
{
switch (e)
{
case 1:word=a+a1;
output+=word;
break ; case 2:word=a+a2;
output+=word;
break; case 3:word=a+a3;
output+=word;
break;
} return;
}public int method (int b) {
int y;
if (b%6==0)
if(b%8==0)
y=3;
else y=2;
else
y=1; return y;
}public static void main ( String [] args){ order=1+(int)((Math.random())*3); switch(order)
{
case 1:
d=method(b1);
methods(d);
break; case 2:
d=method(b2);
methods(d);
break; case 3:
d=method(b3);
methods(d);
break;
} System.out.println("please press the key enter\r");
System.out.println("hello,"+output);
System.exit(0); }
}
解决方案 »
- 在java文件中定义八进制和二进制值,在线等
- 请问下System.out.println("12".split("").length);输出为什么是3
- JS设置主页 弹出的框怎么获取 用户点啦“是”还是“否”呢
- 关于怎样使用(系统类)的问题
- 如何用java生成一副gif图片?
- Runtime.exec 问题
- java中的对象传递问题
- 请教关于jmf的问题,请大家帮忙!!!我已经搞了好多天了,还是没有解决
- 关于jar xf *.jarFile 命令在ant中的实现!各位谁见过或者用过?分肯定给!即使解决不了!谢谢了!
- 如何获得系统支持字体?
- java 的简单问题 10 ???/*145*/
- 请都高手,在java中传址怎么实现?
{
static int order,d, b1=2,b2=6,b3=24; static String output="",
a1="very good",
a2="much better",
a3="the best",
a="it's ",
word;
public void keyi ()
{ } public static void methods (int e)
{
switch (e)
{
case 1:word=a+a1;
output+=word;
break ; case 2:word=a+a2;
output+=word;
break; case 3:word=a+a3;
output+=word;
break;
} return;
}public static int method (int b) {
int y;
if (b%6==0)
if(b%8==0)
y=3;
else y=2;
else
y=1; return y;
}public static void main( String [] args){ order=1+(int)((Math.random())*3); switch(order)
{
case 1:
d=method(b1);
methods(d);
break; case 2:
d=method(b2);
methods(d);
break; case 3:
d=method(b3);
methods(d);
break;
} System.out.println("please press the key enter\r");
System.out.println("hello,"+output);
System.exit(0); }
}
static int order,d;
static int b1=2,b2=6,b3=24;
static String output="",a1="very good",a2="much better",a3="the best",a="it's ",word;
public void keyi () {
}
public static void methods (int e) {
switch (e){
case 1: word=a+a1;
output+=word;
break ;
case 2: word=a+a2;
output+=word;
break;
case 3: word=a+a3;
output+=word;
break;
}
return;
} public static int method (int b){
int y;
if (b%6==0)
if(b%8==0)
y=3;
else
y=2;
else
y=1; return y;
} public static void main ( String [] args) {
order=1+(int)((Math.random())*3);
switch(order){
case 1: d=method(b1);
methods(d);
break;
case 2: d=method(b2);
methods(d);
break;
case 3: d=method(b3);
methods(d);
break;
}
System.out.println("please press the key enter\r");
System.out.println("hello,"+output);
System.exit(0);
}
}