📄 e062. getting the superclass of an object.txt
字号:
Object o = new String();
Class sup = o.getClass().getSuperclass(); // java.lang.Object
// Superclass of Object is null
o = new Object();
sup = o.getClass().getSuperclass(); // null
// Although the type of o2 is an interface, getSuperclass() returns the object's superclass
Runnable o2 = new Runnable() {
public void run() {
}
};
sup = o2.getClass().getSuperclass(); // java.lang.Object
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -