Creating Java Files

The actual Java code that we'll write is stored in plain text files holding Java statements and declarations. To store Java code in a file, you can use a simple text editor or as fancy a word processor as you like, as long as the result is a plain text file without any fancy formatting that the Java compiler can't handle. You can use whatever text editor you prefer, such as vi in UNIX, or WordPad in Windows.

You should give such files the extension .java because the Java compiler expects that extension. As you saw, I saved the application named app in a file named app.java. This Java file is the one that you'll pass to the Java compiler to create a bytecode file. A very important point to remember is that the file into which ...

Get Inside XML 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.