O'Reilly logo

XML and Java™ from scratch by Nicholas Chase

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

Reading a File from a Java Application

Now that we've got the basics, we're ready to start looking at our files. We'll start with something simple, like reading the XML file and displaying it on the screen. But first, let's look at the way that Java handles variables because there are similarities in how it handles objects.

Declaring Variables

Variable— A variable is simply a place in memory that holds information. If we assign a value of “Nick” to the variable name, we can use name throughout the program, and Java will substitute “Nick.” That way, we can change the value in one place, and it will take effect everywhere. The most common use for ...

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