A
A
Alexander2019-09-02 10:40:50
Java
Alexander, 2019-09-02 10:40:50

Is there a function in Java to view the methods of an object?

Python has a wonderful dir() function that allows you to output, for example, to the console all the methods of a particular object.
Is there a similar one in Java?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2019-09-02
@aleks0010

There is reflection, but you should not use it. If in a language with static typing you need to get a list of methods at runtime, then you are doing something wrong.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question