📄 testexception.java
字号:
import com.kettas.common.*;
public class TestException{
public static void main(String args[]){
int a = 10;
int b = SystemIn.readInt();
if ( b != 0 ) System.out.println(a/b);
//System.out.println(1.0/0); Infinity
int n[] = new int[4];
if ((b>=0) && (b<n.length)) System.out.println(n[b]);
Animal animal = new Dog();
if (animal instance of Cat) {
Cat c = (Cat) animal;
}
if (animal != null){
animal.eat();
}
}
}
class Animal{
public void eat(){};
}
class Dog extends Animal{}
class Cat extends Animal{}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -