O'Reilly logo

Beginning Programming with Java For Dummies, 5th Edition by Barry A. Burd

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 22

Ten Useful Classes in the Java API

IN THIS CHAPTER

check Finding out more about classes

check Discovering other helpful classes

I’m proud of myself. I’ve written around 400 pages about Java using fewer than 30 classes from the Java API. The standard API has thousands of classes, so I think I’m doing very well.

Anyway, to help acquaint you with some of my favorite Java API classes, this chapter contains a brief list. Some of the classes in this list appear in examples throughout this book. Others are so darn useful that I can’t finish the book without including them.

For more information on the classes in this chapter, check Java’s online API documentation at http://docs.oracle.com/javase/8/docs/api.

ArrayList

Chapter 16 introduces arrays. This is good stuff, but in any programming language, arrays have their limitations. For example, take an array of size 100. If you suddenly need to store a 101st value, you’re plain out of luck. You can’t change an array’s size without rewriting some code. Inserting a value into an array is another problem. To squeeze "Tim" alphabetically between "Thom" and "Tom", you may have to make room by moving thousands of "Tyler", "Uriah", and "Victor" names.

But Java has an ArrayList class. An ArrayList is like an array, except that ArrayList objects grow ...

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