Chapter 3: Arrays and Strings

"First things first, but not necessarily in that order."
—Doctor Who

Introduction

Hopefully, you now have a reasonably good understanding of the basics of Java programming and are fairly comfortable using primitive data types, conditional statements, loops, and methods. In this chapter we first take a look at arrays, their importance in programming, and how they are used in Java. We then delve into strings, where you will learn about the String class and other useful string-related classes, such as the StringBuffer and StringTokenizer. We have already looked very briefly at objects at the beginning of the previous chapter with the Person class but have yet to use objects properly in any code examples. In Java, arrays and strings are objects, which means we are now about to start using objects for the first time. This should also provide us with a solid introduction in preparation for Chapter 4, "Multiple Classes."



Java 1.4 Game Programming
Java 1.4 Game Programming (Wordware Game and Graphics Library)
ISBN: 1556229631
EAN: 2147483647
Year: 2003
Pages: 237

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net