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 ...

Get XML and Java™ from scratch now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.