当前位置: 技术问答>java相关
在同一个.java文件中定义的Class有什么限制?
来源: 互联网 发布时间:2015-02-07
本文导语: 代码如下: ClassesForTest.java public class ClassesForTest extends java.lang.Object {} class DefaultClass {} protected class ProtectedClass {} private class PrivateClass {} abstract class AbstractClass {} final class FinalClass {} interfac...
代码如下: ClassesForTest.java
public class ClassesForTest extends java.lang.Object {}
class DefaultClass {}
protected class ProtectedClass {}
private class PrivateClass {}
abstract class AbstractClass {}
final class FinalClass {}
interface InterfaceClass { }
编译时提示
modifier protected 和 private not allowed here
public class ClassesForTest extends java.lang.Object {}
class DefaultClass {}
protected class ProtectedClass {}
private class PrivateClass {}
abstract class AbstractClass {}
final class FinalClass {}
interface InterfaceClass { }
编译时提示
modifier protected 和 private not allowed here
|
你没有MAIN方法啊~都是内部类啊~