//在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); }
}
{
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);
}
}