how to explore an object methods and its attributes in Java without documentation | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

how to explore an object methods and its attributes in Java without documentation

In python we can use dir(object) to explore the class methods and its attributes, is there a way to have similar function in Java?

2nd Nov 2016, 6:04 AM
yellofam
1 Answer
+ 1
You can use the getMethods() function, which operates on a Class object. To get the Class of your object obj you can use obj.getClass ().
2nd Nov 2016, 7:39 AM
Bart Genuit
Bart Genuit - avatar