暖皮什么头发颜色好看:错在哪里???

来源:百度文库 编辑:查人人中国名人网 时间:2024/05/07 17:37:40
public class test1{
public static void main(string[] args) {
System.out.println("there is a bomb,it is going to bang!a red line and a blue line is ahed of you ,which do you choose to cut?(a=red,b=blue)");
static char a;
a=System.in.read();
static void b(char c="a")
{if test1.a==c
System.out.println("oh ,my god ,you sucessed!!");
else
System.out.println("no, my god ,you are going to death!!");
};
}
}//end

这个无法编译,得到的错误为:
test1.java:4: 非法的表达式开始
static char a;
^
test1.java:6: 非法的表达式开始
static void b(char c="a")
^
本人太菜,请高手不吝指教!!

static void b(char c="a")
{if test1.a==c
System.out.println("oh ,my god ,you sucessed!!");
else
System.out.println("no, my god ,you are going to death!!");
};

你这段写在里面算是什么结构?

static char a;是什么? 定义a 为char型数据吗?
static void b(char c=\"a\") c 在哪 定义的 再有你的static后面接char a;有这个表达方式吗? 我好久没看书了忘记了对不对 但你可以看看书如果可以的话应该就是a和c 的定义错了