Jython等价于javacod

2024-09-30 12:31:31 发布

您现在位置:Python中文网/ 问答频道 /正文

我想把下面的Java代码转换成Jython代码。我对Java知之甚少。你知道吗

String name = connection.runReadAction(new ReadActionResult<String>()
{
     public String execute(SystemAccess access) throws Exception
     {
        return access.getTree(SystemTree.Geographic).resolve(path).getDisplayName();
     }
 });

你能帮我做这个任务吗?你知道吗


Tags: 代码namenewexecutestringaccessexceptionjython
1条回答
网友
1楼 · 发布于 2024-09-30 12:31:31
def execute(access):
  return access.getTree(SystemTree.Geographic).resolve(path).getDisplayName()

name = connection.runReadAction(readActionResult=execute)

Jython处理创建匿名内部类的混乱细节。你知道吗

相关问题 更多 >

    热门问题