求教java问题public class Outer {
public static void main(String[]args) {
System.out.println(Face.Ear.Breaath());
}
}
class Face{
static class Ear{
static int a=1;
static void Breaath() {
System.out.println("我在听");
}
}
}
这是错误原因The method println(boolean) in the type PrintStream is not applicable for the arguments (void)
请教怎么调用void Breaath() 方法啊,谢谢了
System.out.println(Face.Ear.Breaath()); 这句错了。因为你的void Breaath() 方法返回值是void,system.out.println()不接受void参数。追问
那这个怎么调,
就是不该void类型怎么调用
不改
温馨提示:答案为网友推荐,仅供参考