Java_println关键字打印一个无参的方法是不可以的。

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/pmcasp/article/details/81125940

class Test{

  public void a(){}

  public static void main(String[] args){

    Test b=new Test();

    System.out.println(b.a());              //error

  }

}

The method println(boolean) in the type PrintStream is not applicable for the arguments (void)

控制台输出(println)不能打印一个空参数(void)的方法

猜你喜欢

转载自blog.csdn.net/pmcasp/article/details/81125940
今日推荐