怎么将下面的java转成python
1个回答
2017-09-28
展开全部
怎么将下面的java转成python
如下的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!’
如下的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!’
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询