Chapter 1 JAVA
Chapter 1 JAVA
What is Programming? The term programming means to create (or develop) software,
which is also called a program. In basic terms, a program is a set of instructions that you write to
tell a computer what to do. A software developer creates programs with the help of powerful
tools called programming languages. Every programming language has its own syntax, or rules
of the language. Using a programming language, programmers write a series of program
statements, similar to English sentences, to carry out the tasks they want the program to perform.
After the program statements are written, programmers use a computer program called a
compiler or interpreter to translate their language statements into machine code. A compiler
translates an entire program before carrying out the statement, or executing it, whereas an
interpreter translates one program statement at a time, executing a statement as soon as it is
translated.
Compilers and interpreters issue one or more error messages each time they encounter an
invalid program statement—that is, a statement containing a syntax error, or misuse of the
language. Locating and repairing all syntax errors is part of the process of debugging a program.
In addition to learning the correct syntax for a particular language, a programmer also
must understand computer programming logic. The logic in programming involves executing the
various program statements and procedures in the correct order to produce the desired results.
Programmers call some logical errors semantic errors. For example, if you misspell a
programming language word, you commit a syntax error, but if you use a correct word in the
wrong context, you commit a semantic error.
This work text teaches you how to create programs by using the Java programming
language.
Java as a language has significant advantages over other languages and other
programming environments that make it suitable for just about any programming task. This
section describes some of those advantages.
Object Oriented: In Java, everything is an Object. Java can be easily extended since it
is based on the object model.
Simple: Java is designed to be easy to learn. If you understand the basic concept of
OOP, Java would be easy to master.
Secure: With Java's secure feature, it enables to develop virus-free, tamper-free
systems. Authentication techniques are based on public-key encryption.
Architectural-neutral: Java compiler generates an architecture-neutral object file
format, which makes the compiled code to be executable on many processors, with the presence
of Java runtime system.
Portable: Being architectural-neutral and having no implementation dependent aspects
of the specification makes Java portable.
Robust: Java makes an effort to eliminate error prone situations by emphasizing mainly
on compile time error checking and runtime checking.
Multithreaded: With Java's multithreaded feature, it is possible to write programs that
can do many tasks simultaneously. This design feature allows developers to construct smoothly
running interactive applications.
Distributed: Java is designed for the distributed environment of the internet.
Dynamic: Java is considered to be more dynamic than C or C++ since it is designed to
adapt to an evolving environment. Java programs can carry extensive amount of runtime
information that can be used to verify and resolve accesses to objects on run-time.