O'Reilly logo

Scripting in Java: Integrating with Groovy and JavaScript by Kishori Sharan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 7

image

Collections

In this chapter, you will learn:

  • What arrays in Nashorn are
  • How to create arrays in Nashorn using array literals and the Array object
  • How to use different methods of the Array object
  • How to work with array-like objects
  • How to create and use typed arrays in Nashorn
  • How to use Java collections in Nashorn
  • How to create Java arrays in Nashorn
  • How to convert Java arrays to Nashorn arrays and vice versa

What Is an Array in Nashorn?

An array in Nashorn is a specialized object, called an Array object, which is used to represent an ordered collection of values. An Array object treats certain property names in a special way. If a ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required