In some Java IDEs (BlueJ and DrJava, for example), the user can open an interaction window where Java expressions and statements can be typed in. The IDE quickly compiles and runs the code, displaying the returned value if necessary.
In BlueJ, it's called the Code Pad. It's similar in spirit to the Interaction Pane in DrRacket/DrScheme.
Does something like this exist for Eclipse?
You may be looking for Scrapbook pages. Here's a write-up and here are other SO questions which talk about it.