求教java问题

求教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类型怎么调用

不改

温馨提示:答案为网友推荐,仅供参考

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网