怎么将下面的java转成python
2个回答
2017-09-19
展开全部
如下的java代码:/***Helloworld!**/publicclassApp{publicstaticvoidmain(String[]args){System.out.println("HelloWorld!");}}12345678910111234567891011转换后的代码:#!/usr/bin/envpython"""generatedsourc
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
如下的java代码:
/**
* Hello world!
*
*/
public class App
{
public static void main( String[] args )
{
System.out.println( "Hello World!" );
}
}12345678910111234567891011
转换后的代码:
#!/usr/bin/env python
""" generated source for module App """
#
# * Hello world!
# *
#
class App(object):
""" generated source for class App """
@classmethod
def main(cls, args):
""" generated source for method main """
print "Hello World!"
if __name__ == '__main__':
import sys
App.main(sys.argv)12345678910111213141516171234567891011121314151617
然后运行python代码,打印出了 ‘hello world!’
/**
* Hello world!
*
*/
public class App
{
public static void main( String[] args )
{
System.out.println( "Hello World!" );
}
}12345678910111234567891011
转换后的代码:
#!/usr/bin/env python
""" generated source for module App """
#
# * Hello world!
# *
#
class App(object):
""" generated source for class App """
@classmethod
def main(cls, args):
""" generated source for method main """
print "Hello World!"
if __name__ == '__main__':
import sys
App.main(sys.argv)12345678910111213141516171234567891011121314151617
然后运行python代码,打印出了 ‘hello world!’
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询