Java的8允许定义内部接口的静态方法,但restricts它调用的唯一接口名称: 9.4: An interface can declare static methods, which are invoked without reference to a particular object. 如: interface X {
static void y() {
}
}
我正在试验一个Java端口some C# code,我惊讶地发现javac 1.8.0_60每次访问对象字段时都会发出一个getfield操作码。 这里是Java代码: public class BigInteger
{
private int[] bits;
private int sign;
//...
public byte[] ToByteAr
我对这个程序的输出有点迷惑: public class xx {
public static void main(String[] args) throws Exception {
Number x = false ? new Long(123) : new Integer(456);
System.out.println(x + " isa " + x.getC