getMethods(), java [英] getMethods(), java

查看:35
本文介绍了getMethods(), java的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在java中,方法'Class.getMethods()'返回接收者类及其超类中所有方法的数组.有没有像 Class.getMethods() 这样的方法,它只给我们类的方法,而没有从其超类中继承的方法?

In java, the method 'Class.getMethods()' returns an array of all the methods in the reciever class and also its superclasses. Is there such a method like Class.getMethods() which only give us the class's methods, without those which are inhereted from its superclasses?

推荐答案

getDeclaredMethods()

这篇关于getMethods(), java的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆