Is there something like python\'s interactive REPL mode, but for Java?
So that I can, for example, type InetAddress.getAllByName( localHostName )
in a window, a
For folks with access to Mathematica, JLink lets you access Java and script with Mathematica code:
Needs["JLink`"]
LoadJavaClass["java.net.InetAddress"]
InetAddress`getAllByName["localhost"]
Hit Shift-Enter to evaluate, and you get
{<>}
Then you can use Mathematica's Map function to call toString
on the returned objects:
#@toString[]& /@ %
to get the result (or to use the less obscure syntax, Map[Function[obj, obj@toString[]], %]
):
{"localhost/127.0.0.1"}
If you start to get serious with this, you'll want to read Todd Gayley's tutorial at http://reference.wolfram.com/mathematica/JLink/tutorial/Overview.html.