Java--static interface
http://stackoverflow.com/questions/8374646/what-is-a-static-interface-in-java
http://stackoverflow.com/questions/71625/why-would-a-static-inner-interface-be-used-in-java
Static inner interface and inner interface is the same, all access rules are the same as with inner static class. So inner interface can be accessible only if you have access to its parent class/interface. In case below you will have access to interface B only from package of interface A, because A has default access modifier. BTW: interface B could be static or not.
interface A {
void testA();
public interface B {
void testB();
}
}
The static
modifier is only allowed on a nested classes or interfaces.
Java--static interface的更多相关文章
- Java Native Interface 六JNI中的异常
本文是<The Java Native Interface Programmer's Guide and Specification>读书笔记 在这里只讨论调用JNI方法可能会出现的异常, ...
- Java Native Interface 五 JNI里的多线程与JNI方法的注册
本文是<The Java Native Interface Programmer's Guide and Specification>读书笔记 JNI里的多线程 在本地方法里写有关多线程的 ...
- Java Native Interface 四--JNI中引用类型
本文是<The Java Native Interface Programmer's Guide and Specification>读书笔记 JNI支持将类实例和数组类型(如jobjec ...
- Java Native Interface 二 JNI中对Java基本类型和引用类型的处理
本文是<The Java Native Interface Programmer's Guide and Specification>读书笔记 Java编程里会使用到两种类型:基本类型(如 ...
- Java Native Interface 编程系列一
本文是<Java Native Interface Programmer's Guide and Specification>的读书笔记 Java Native Interface可以让编 ...
- Java注释@interface的用法【转】
Java用 @interface Annotation{ } 定义一个注解 @Annotation,一个注解是一个类.@Override,@Deprecated,@SuppressWarnings为 ...
- Java注释@interface的用法
转---------- java用 @interface Annotation{ } 定义一个注解 @Annotation,一个注解是一个类.@Override,@Deprecated,@Suppr ...
- Java Native Interface Specification—Contents
http://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/jniTOC.html 1. Introduction Java Nati ...
- Java Interface是存放常量的最好地方吗?(转)
虽然Inteface中默认常量就是static final 的.因此很多人就认为其实存放常量的最佳地方,effective java中就提过,不建议使用常量接口.其有一个原因就是:代码编译问题 好,我 ...
- Java接口interface
Java接口interface 1.多个无关的类可以实现同一个接口. 2.一个类可以实现多个无关的接口. 3.与继承关系类似,接口与实现类之间存在多态性. 接口(interface)是抽象方法和常量值 ...
随机推荐
- Oracle 中包的应用
包由两个分离的部分组成:包头(PACKAGE)和包体(PACKAGEBODY).包头是包的说明部分,是对外的操作接口,对应用是可见的;包体是包的代码和实现部分,对应用来说是不可见的黑盒. ...
- Database JDBC Developer's Guide
http://docs.oracle.com/database/121/JJDBC/datacc.htm#JJDBC28363
- volatile详解
海子的Java并发编程:volatile关键字解析讲的已经非常不错了,通俗易懂,给32个赞!
- yii第一个应用blog
1. 连接到数据库 大多数 Web 应用由数据库驱动,我们的测试应用也不例外.要使用数据库,我们首先需要告诉应用如何连接它.修改应用的配置文件 WebRoot/testdrive/protected/ ...
- 【转】Java基本数据类型
原文网址:http://blog.csdn.net/bingduanlbd/article/details/27790287 Java语言是静态类型的(statical typed),也就是说所有变量 ...
- C#优秀开源资料收集
1. 把对命令行程序的调用封装起来,通过程序里进行输入,调用命令行程序的输出显示在程序中 http://www.codeproject.com/Articles/335909/Embedding-a- ...
- 值传递 & 引用传递
以下程序的输出结果是? public class Example { String str = new String("good"); char[] ch = { 'a', 'b' ...
- LinQ 语法基础
LINQ (Language-Integrated Query,语言集成查询). LINQ to Objects.LINQ to SQL.LINQ to DataSet和LINQ to XML,它们分 ...
- High bridge, low bridge(离散化, 前缀和)
High bridge, low bridge Q:There are one high bridge and one low bridge across the river. The river h ...
- [j2ee][IDEA properties中文乱码解决]
http://my.oschina.net/pengzai/blog/133908 在project settings - File Encoding,在标红的选项上打上勾,确定即可