是否有像python的交互式REPL模式,但对于Java? [英] Is there something like python's interactive REPL mode, but for Java?

查看:130
本文介绍了是否有像python的交互式REPL模式,但对于Java?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有像python的交互式REPL模式,但对于Java?
例如,我可以在一个窗口中输入 InetAddress.getAllByName(localHostName),并立即获得结果,而不是所有这些public static void nightmare()东西?

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, and immediately get results, without all this public static void nightmare() thing?

推荐答案

您也可以使用 Groovy控制台。它是一个交互式控制台,您可以在其中执行所需的操作。由于Groovy还包含来自核心java平台的类,因此您也可以使用这些类。

You can also use Groovy Console. It is an interactive console where you can do what you want. Since Groovy also includes classes from the core java platform, you'll be able to use those classes as well.

编辑

它看起来像这样:

这篇关于是否有像python的交互式REPL模式,但对于Java?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆