Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 7. Arrays > Wrap-Up

7.14. Wrap-Up

This chapter began our introduction to data structures, exploring the use of arrays to store data in and retrieve data from lists and tables of values. The chapter examples demonstrated how to declare an array, initialize an array and refer to individual elements of an array. The chapter introduced the enhanced for statement to iterate through arrays. We also illustrated how to pass arrays to methods and how to declare and manipulate multidimensional arrays. Finally, the chapter showed how to write methods that use variable-length argument lists and how to read arguments passed to a program from the command line.

We continue our coverage of data structures in Chapter 15 with generics, which provide the means to create general models of methods and classes that can be declared once, but used with many different data types. In Chapter 16, Collections, we introduce the Java Collections Framework, which uses generics to allow you to specify the exact types of objects that a particular data structure will store. Chapter 16 also introduces Java’s predefined data structures, which you can use instead of building your own. Chapter 16 discusses many data structures classes, including Vector and ArrayList, which are array-like data structures that can grow and shrink in response to a program’s changing storage requirements. The Collections API also provides class Arrays, which contains utility methods for array manipulation. Chapter 16 uses several static methods of class Arrays to perform such manipulations as sorting and searching the data in an array. You’ll be able to use some of the Arrays methods discussed in Chapter 16 after reading the current chapter, but some of the Arrays methods require knowledge of concepts presented later in the book.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint