Interactive interpreter for Java

Is there a good interactive interpreter for Java similar to Scala? In programming, I would like to try small snippets of code to see if they work as I expect before connecting them to my main program. I would prefer an interpreter that is not network based, as I often work offline.

Thanks in advance!

+5
source share
4 answers

In the past, I used beanshell. It was really easy and got its job. http://www.beanshell.org/

+1
source

Scala JVM, Scala? , , Java.

, .

scala> System.getPropert
getProperties   getProperty
scala> System.getProperty("user.home")
res0: String = c:\Users\robert

, Scala, , :

scala> val testMap = new java.util.HashMap[String, java.util.List[String]]
testMap: java.util.HashMap[String,java.util.List[String]] = {}

scala> testMap.put("planets", java.util.Arrays.asList("Mars", "Jupiter", "Pluto"
))
res0: java.util.List[String] = null

scala> testMap.get("planets")
res1: java.util.List[String] = [Mars, Jupiter, Pluto]
+2

Dr. Java. interactions, . , , , . . private, Dr. Java interactions .

+1

BlueJ . , , (?) Sun, , . , , , , , main(). , , ( ) . , Eclipse.

http://www.bluej.org/about/what.html

+1

All Articles