How does the Interactions interpreter differ from standard Java?
You can think of the Interactions interpreter as a step-by-step evaluator for a “main” method body. However, to make usage more convenient, a number of extensions are supported. There may be an option to turn these features off in a future release. • The statement java SomeClass arg1 arg2 is a shortcut for SomeClass.main(new String[]{ arg1, arg2 }). • Import and package statements can appear, and can be interleaved with other declarations and statements. These affect the meaning of names in subsequent references. • Variables (and other declarations) can be shadowed by redeclarations. • A variable can be declared without an explicit type; the type is inferred. • Arbitrary expressions can appear at the top level. If followed by a semicolon, the result of evaluation is not printed. • Exceptions are “caught” and printed at the same scope in which they are thrown—the top level—leading to the possibility that some variables might be statically declared but not dynamically initialized. In thi