I have a method and want to examine variables inside it without debugging - is it possible in Java?
I do not want to write tons of code like:
Syste
I want to have something like:
System.out.printLocals();
Also it should be great to have something like:
System.out.printMembersOf(someObjectInstance);
Just about every Java class has a toString
method. You override that method, and you can get a string that represents what you're asking for.
Eclipse Helios, among other IDEs, will generate a basic toString
method for you.