编译while方法没有返回任何值

时间:2014-08-22 10:28:09

标签: java

因为我是JAVA的新手,尝试一些概念。请看下面'test'code:

public class Test {

    public int a() {
         while (true);
//         return 1;   

    }

    public static void main(String[] args) {

    }
}

问题: 即使方法a()没有返回任何值,我也不确定它为什么成功编译?

0 个答案:

没有答案
相关问题