|
Java Translation and Execution
|
bet | 9/10 | Sana | 22.07.2024 | Hajmi | 225,5 Kb. | | #268238 |
Bog'liq slides01 - The Java compiler translates Java source code into a special representation called bytecode
- Java bytecode is not the machine language for any traditional CPU
- Another software tool, called an interpreter, translates bytecode into machine language and executes it
- Therefore the Java compiler is not tied to any particular machine
- Java is considered to be architecture-neutral
Java Translation and Execution - There are many development environments which develop Java software:
- Sun Java Software Development Kit (SDK)
- Borland JBuilder
- MetroWork CodeWarrior
- Microsoft Visual J++
- Symantec Café
- Though the details of these environments differ, the basic compilation and execution process is essentially the same
Syntax and Semantics - The syntax rules of a language define how we can put symbols, reserved words, and identifiers together to make a valid program
- The semantics of a program statement define what that statement means (its purpose or role in a program)
- A program that is syntactically correct is not necessarily logically (semantically) correct
- A program will always do what we tell it to do, not what we meant to tell it to do
Errors - A program can have three types of errors
- The compiler will find problems with syntax and other basic issues (compile-time errors)
- If compile-time errors exist, an executable version of the program is not created
- A problem can occur during program execution, such as trying to divide by zero, which causes a program to terminate abnormally (run-time errors)
- A program may run, but produce incorrect results (logical errors)
|
| |