New Programmers

   

Java™ 2 Primer Plus
By Steven Haines, Steve Potts

Table of Contents
Chapter 2.  Keywords, Data Types, and Variables


Before you can write a computer program, you must learn a set of rules that define how a computer program can be written. There are two sets of rules: syntax and semantics. Syntax defines the rules by which a program must adhere to be processed by the compiler. Semantics defines the logical rules that make a computer program do what you want it to.

The Java programming process is as follows:

  1. You write a Java program and save it as a text file with the .java file extension.

  2. The Java compiler reads your program and ensures that it is syntactically correct according to the rules of the language.

  3. The Java compiler generates a new file with a .class file extension that contains byte-code instructions that will be later interpreted by a Java Virtual Machine (JVM).

  4. A Java Virtual Machine interprets the byte-code and performs the instructions defined in it.

  5. The results of the execution depend on the semantics of your program.

This chapter explains the basics of the Java programming language syntax.


       
    Top
     



    Java 2 Primer Plus
    Java 2 Primer Plus
    ISBN: 0672324156
    EAN: 2147483647
    Year: 2001
    Pages: 332

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