javamethod(...) invoke an instance method
The JavaMethod object is a JavaScript representation of a Java method. It is the part of LiveConnect that implements the functionality that allows JavaScript to invoke class and instance methods accessed through the JavaClass and JavaObject objects. See Chapter 19, LiveConnect: JavaScript and Java for full details.
Bear in mind that Java is a typed language. This means that the arguments passed to a JavaMethod must be compatible with the type of the expected arguments. If arguments of the wrong type are passed, a JavaScript error will occur.
java.lang is the name of a JavaPackage. It contains the JavaClass java.lang.System This class has a property out which is an JavaObject. This JavaObject has a property println, which is a JavaMethod. LiveConnect allows us to invoke this Java method using JavaScript syntax with code like the following:
java.lang.System.out.println("Hello from Java!");
"getClass()", "java", "JavaArray", "JavaClass", "JavaObject", "JavaPackage", "Packages", Chapter 19, LiveConnect: JavaScript and Java
file: /Techref/language/JAVA/script/definitive/refp_181.htm, 5KB, , updated: 2019/10/14 15:00, local time: 2024/12/13 05:38,
18.226.34.198:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://techref.massmind.org/Techref/language/JAVA/script/definitive/refp_181.htm"> [Chapter 21] Reference: JavaMethod</A> |
Did you find what you needed? |
Welcome to massmind.org! |
Welcome to techref.massmind.org! |
.