有没有i==-i?这是个令人纠结的问题,为了以后忘记在此写一下:Integer.MIN_VALUE它满足这个表达式。
有没有表达式能使这个循环无限下去?
- while(i<=j&&j<=i&&i!=j){}
下面这个就可以做到这点:
- Integer i=new Integer(0);
- Integer j=new Integer(0);
- interface Type1
- {void f()throws CloneNotSupportedException;}
- interface Type2
- {void f() throws InterruptedException;}
- interface Type3 extends Type1,Type2
- { }
- public class Arcane3 implements Type3
- {public void f(){
- System.out.println("hello world!");
- }
- public static void main(String args[]){Type3 t3=neew Arcane3();t3.f();}
- }
上面这个程序初看觉得它很有问题,因为在main没有捕获异常,但是实际上它是能通过编译的,因为一个方法可以抛出的受检查异常集合是它所适用的所有类型声明要抛出的受检查异常集合的交集。
转载于:https://blog.51cto.com/chinatong/1186267