Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
可能重复: 我可以得到一个类的所有方法吗?
有没有办法在java中显示某个类的所有可用方法?
通过反思:
public static void main(String[] args){ for (Method method : YourClass.class.getMethods()) { System.out.println(method.getName()); } }
您可以使用 Java反射来获取有关类的所有信息。