Exception in thread "main" java.lang.Error: Unresolved compilation problem: Unreachable code

public void eat(){ System.out.println("客户吃饭"); return; //return后不可以声明表达式 System.out.println("hello"); }
return后边不可以再写代码。

posted @ 2021-03-05 17:57  李家成  阅读(363)  评论(0)    收藏  举报