1、此文档是毕业设计外文翻译成品( 含英文原文+中文翻译) ,无需调整复杂的格 式!下载之后直接可用,方便快捷!本文价格不贵,也就几十块钱!一辈子也就 一次的事! 外文标题:Using Java in Scripting Languages 外文作者:Kishori Sharan 文献出处: Scripting in Java Integrating with Groovy and JavaScript,2018 (如觉得年份太老,可改为近 2 年,毕竟很多毕业生都这样做) 英文 2244 单词,12911 字符(字符就是印刷符),中文 3250 汉字。 (如果字数多 了,可自行删减,大多数学校都
2、是要求选取外文的一部分内容进行翻译的。 ) Using Java in Scripting Languages In this chapter, you will learn: 1.How to import Java classes into scripts 2.How to create Java objects and use them in scripts 3.How to call overloaded methods of Java objects 4.How to create Java arrays 5.How to extend a Java class and implem
3、ent Java interfaces in scripts 6.How to invoke superclass methods of an object from scripts Scripting languages allow using Java class libraries in scripts. Each scripting language has its own syntax for using Java classes. It is not possible, and is outside the scope of this book, to discuss the sy
4、ntax of all scripting languages. In this chapter, I will discuss the syntax of using Java constructs in Nashorn. Importing JavaTypes There are four ways to import Java types into Nashorn script: 1.Using the Packages global object 2.Using the type( ) method of the Java global object 3.Using the import Package( ) and import Class( ) functions 4.Using a Java Importer in a with clause Of the four types of importing Java types, the second type, using the type( ) method of the global Java obj