Beruflich Dokumente
Kultur Dokumente
HO – # 1 (Introduction To Programming)
INTRODUCTION TO JAVA
TOPICS:
Defining Programming and its importance
History of Programming
History of Java
Features of Java
Installing Java
Defining Compiling, Interpreting and Linking
Page 1 of 9
(PROGRAMMING I)
HO – # 1 (Introduction To Programming)
1.3. LEVELS OF PROGRAMMING LANGUAGES
a) Absolute Machine Code
The very lowest possible level at
which you can program a computer
is in its own native machine code,
consisting of strings of 1's and 0's
and stored as binary numbers.
b) Assembly Language
Assembly language is nothing more
than a symbolic representation of
machine code, which also allows
symbolic designation of memory
locations.
c) Compiler Language
Compiler languages are the high-
level equivalent of assembly
language. Each instruction in the
compiler language can correspond to
many machine instructions. Once
the program has been written, it is
translated to the equivalent machine
code by a program called a compiler.
Once the program has been
compiled, the resulting machine
code is saved separately, and can be Fig. 3 A source code in Java consisting of
run on its own at any time. syntaxes or statements. This is a program that is
compiled into ByteCode.
d) Interpreter Language
An interpreter language, like a
compiler language, is considered to
be high level. However, it operates in
a totally different manner from a
Page 2 of 9
(PROGRAMMING I)
HO – # 1 (Introduction To Programming)
compiler language. Rather, the
interpreter program resides in
memory, and directly executes the
high-level program without
preliminary translation to machine
code.
Page 3 of 9
(PROGRAMMING I)
HO – # 1 (Introduction To Programming)
a.3. You will be given a list of search results. Click the link that has the following web address:
a.4. On the Java Downloads page, click the Red button with the label “Free Java Download”.
Then, notice at the bottom (Google Chrome) that the download will start. This is the JDK
installer and should Chrome ask you “Do you want to keep the file?” Click “Yes”
a.5. A window such as this will open (but before that you must select “Yes” to the “Do you want
this program to make changes to this computer?”).
Then, on this window click “Install”.
Page 4 of 9
(PROGRAMMING I)
HO – # 1 (Introduction To Programming)
a.7. Then, the computer shall download the installer of Java. Wait for the progress bar (the green
one) to complete.
a.8. Then, once the installer has been downloaded, this window will appear. Again, wait patiently
for the JDK to install itself.
a.9. After the successful installation of the JDK, this window will appear. Click the “Close”
button.
Page 5 of 9
(PROGRAMMING I)
HO – # 1 (Introduction To Programming)
b. Then, after you have finished downloading the JDK, it’s time for us to choose our editor. In
this case, we shall use the Eclipse IDE.
b.1. Type “Eclipse IDE” on the Search Bar.
b.2. Wait for the page to load. Search and click the link that looks like this:
b.3. Scroll down a little bit. Then, select the “Download Packages” link.
b.4. Select the 32-bit installer. Click the “32 bit” link. Again, click the “Download” button.
b.5. The download will start. Wait for the download to finish.
b.6. Click the downloaded file to run the installer.
Page 6 of 9
(PROGRAMMING I)
HO – # 1 (Introduction To Programming)
b.10. The installation will start. Wait for it to finish. Then click “Close”
a. Compiling
A compiler is a computer program (or a set of programs) that transforms source code written in
a programming language (the source language) into another computer language (the target
language), with the latter often having a binary form known as object code. The most common
reason for converting source code is to create an executable program.
b. Linking
Linking refers to the creation of a single executable file from multiple object files.
Page 7 of 9
(PROGRAMMING I)
HO – # 1 (Introduction To Programming)
c. Interpreting
With computer programming, interpreted or an interpreted language refers to a language that
does not need to be compiled before it is executed. However, because the script or program is not
compiled, it requires an interpreter to run.
An interpreter takes the script or program code and modifies it in such a way that it can be
understood and the executed by the computer.
b. Garbage Collection
● Garbage collection thread
– responsible for freeing any memory that can be freed. This happens automatically
during the lifetime of the Java program.
Page 8 of 9
(PROGRAMMING I)
HO – # 1 (Introduction To Programming)
c. Code Security
● Code security is attained in Java through the implementation of its Java Runtime
Environment (JRE).
● JRE
– runs code compiled for a JVM and performs class loading (through the class loader),
code verification (through the bytecode verifier) and finally code execution
● Class Loader
– Responsible for loading all classes needed for the Java program
– adds security by separating the namespaces for the classes of the local file system
from those that are imported from network sources
● Bytecode verifier
– tests the format of the code fragments and checks the code fragments for illegal code
that can violate access rights to objects
Page 9 of 9