e062. getting the superclass of an object.txt
来自「这里面包含了一百多个JAVA源文件」· 文本 代码 · 共 14 行
TXT
14 行
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 + =
减小字号Ctrl + -
显示快捷键?