202108050659 - Object和String

Object

getClass()

获取getClass()返回的Class对象,看看都有哪些内容

Test test = new Test();  
Class<? extends Test> aClass = test.getClass();  
Method[] methods = aClass.getMethods();  
for (Method method : methods) {  
    System.out.println(method.getName());  
}

# 输出
main
nb
getUUID
wait
wait
wait
equals
toString
hashCode
getClass
notify
notifyAll

没有clone(), finalize()

posted @ 2025-03-19 22:21  钱塘江畔  阅读(8)  评论(0)    收藏  举报