Eclipse has the Display view, where you can enter (almost) arbitrary Java expressions and have them evaluated whenever you are in a breakpoint.
To have any expression evaluated select it (either in the Display view itself, or any open Java source file) and push one of the "inspect", "display" or "evaluate" buttons.
- "inspect" executes the expression and shows the resulting value in a pop-up inspection view (similar to the Variables view).
- "display" executes the expression and prints the resulting value into the Display view
- "evaluate" executes the expression and does nothing else
There some very good help on debugging in Eclipse, specifically about inspecting variables and evaluating expressons.
If you want to test the behavior of some Java code while you're not debugging, then you might want to look into the Scrapbook feature.