aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorsundar <none@none>2013-03-12 18:12:42 +0530
committersundar <none@none>2013-03-12 18:12:42 +0530
commitf29d7f78eb8352878eb82c0ec3af77327f722c5b (patch)
treefd671a36b469bc292f5c88f7d5002d6b3d86e614 /docs
parent44b4bf7de3c8b0c1e2ffc009b183bfa8f250175d (diff)
downloadnashorn-f29d7f78eb8352878eb82c0ec3af77327f722c5b.tar.gz
8009757: Package access clean up and refactoring
Reviewed-by: jlaskey, lagergren, attila --HG-- rename : test/src/jdk/nashorn/internal/test/models/ConstructorWithArgument.java => test/src/jdk/nashorn/test/models/ConstructorWithArgument.java rename : test/src/jdk/nashorn/internal/test/models/DessertTopping.java => test/src/jdk/nashorn/test/models/DessertTopping.java rename : test/src/jdk/nashorn/internal/test/models/DessertToppingFloorWaxDriver.java => test/src/jdk/nashorn/test/models/DessertToppingFloorWaxDriver.java rename : test/src/jdk/nashorn/internal/test/models/FinalClass.java => test/src/jdk/nashorn/test/models/FinalClass.java rename : test/src/jdk/nashorn/internal/test/models/FloorWax.java => test/src/jdk/nashorn/test/models/FloorWax.java rename : test/src/jdk/nashorn/internal/runtime/Nashorn401TestSubject.java => test/src/jdk/nashorn/test/models/Nashorn401TestSubject.java rename : test/src/jdk/nashorn/internal/test/models/NoAccessibleConstructorClass.java => test/src/jdk/nashorn/test/models/NoAccessibleConstructorClass.java rename : test/src/jdk/nashorn/internal/test/models/NonPublicClass.java => test/src/jdk/nashorn/test/models/NonPublicClass.java rename : test/src/jdk/nashorn/internal/test/models/OuterClass.java => test/src/jdk/nashorn/test/models/OuterClass.java rename : test/src/jdk/nashorn/internal/test/models/OverloadedSam.java => test/src/jdk/nashorn/test/models/OverloadedSam.java rename : test/src/jdk/nashorn/internal/test/models/OverrideObject.java => test/src/jdk/nashorn/test/models/OverrideObject.java rename : test/src/jdk/nashorn/internal/test/models/StringArgs.java => test/src/jdk/nashorn/test/models/StringArgs.java rename : test/src/jdk/nashorn/internal/test/models/Toothpaste.java => test/src/jdk/nashorn/test/models/Toothpaste.java
Diffstat (limited to 'docs')
-rw-r--r--docs/JavaScriptingProgrammersGuide.html8
-rw-r--r--docs/source/javaarray.js3
2 files changed, 6 insertions, 5 deletions
diff --git a/docs/JavaScriptingProgrammersGuide.html b/docs/JavaScriptingProgrammersGuide.html
index cf248140..dd243d3a 100644
--- a/docs/JavaScriptingProgrammersGuide.html
+++ b/docs/JavaScriptingProgrammersGuide.html
@@ -533,9 +533,8 @@ with (SwingGui) {
<hr>
<a name="jsarrays" id="jsarrays"></a>
<h3>Creating, Converting and Using Java Arrays</h3>
-<p>While creating a Java object is the same as in Java, to create
-Java arrays in JavaScript we can use Java reflection
-explicitly. But once created the element access or length access is
+<p>
+Array element access or length access is
the same as in Java. Also, a script array can be used when a Java
method expects a Java array (auto conversion). So in most cases we
don't have to create Java arrays explicitly.</p>
@@ -543,7 +542,8 @@ don't have to create Java arrays explicitly.</p>
// <a href="source/javaarray.js">javaarray.js</a>
// create Java String array of 5 elements
-var a = java.lang.reflect.Array.newInstance(java.lang.String.class, 5);
+var StringArray = Java.type("java.lang.String[]");
+var a = new StringArray(5);
// Accessing elements and length access is by usual Java syntax
a[0] = "scripting is great!";
diff --git a/docs/source/javaarray.js b/docs/source/javaarray.js
index b9d93f0d..a02aa3ca 100644
--- a/docs/source/javaarray.js
+++ b/docs/source/javaarray.js
@@ -30,7 +30,8 @@
*/
// create Java String array of 5 elements
-var a = java.lang.reflect.Array.newInstance(java.lang.String.class, 5);
+var StringArray = Java.type("java.lang.String[]");
+var a = new StringArray(5);
// Accessing elements and length access is by usual Java syntax
a[0] = "scripting is great!";