2. ENG. AHMED ELBADAWY - FALL 2016
2
WHAT IS PROGRAMMING ?
LEARNING PROGRAMMING IS A CHALLENGE
COMPUTER PROGRAM STRUCTURE
JAVA PROGRAM LIFE CYCLE
FIRST JAVA PROGRAM (HELLO JAVA)
3. ENG. AHMED ELBADAWY - FALL 2016
3
It’s a set of instructions that were written by a
programmer that tells a computer what to do.
Computer programs come in all shapes and sizes, from
the very simplest ones we’ll look at below (the “Hello,
World!” program is the most well-known) to extremely
large, integrated systems with multiple functionality
controlling factories, big business accounts, banks,
world markets, scientific research, etc. etc.
4. ENG. AHMED ELBADAWY - FALL 2016
4
Why is this? Because you basically have to learn
everything at once.
You can’t write a program that does anything without
knowing something at least about a lot of things, any
more than you should drive a car without knowing about
the accelerator, brake, clutch, gears, road rules,
indicators. . .You can find a nice place to practice driving
where you have to worry about as few of these things as
possible, but you can’t get going without sitting in the
driver’s seat and trying it—so let’s get started!
5. ENG. AHMED ELBADAWY - FALL 2016http://www.shutterstock.com/pic-65752078/stock-photo--d-
rendering-work-flows-concept-input-process-output-isolated-on-white-
background.html?src=LfatOa6qMllGAEym0FJ7FA-1-36
5
Simply computer programs consists of:
6. ENG. AHMED ELBADAWY - FALL 2016
6
There are 4 main processes in the java program life
cycle
WRITE
CODE
SAVE
CODE
COMPILE
CODE
RUN OR
EXECUTE
7. ENG. AHMED ELBADAWY - FALL 2016 http://searchsoftwarequality.techtarget.com/definition/integrated-
development-environment
7
WRITE
CODE
SAVE
CODE
COMPIL
E CODE
RUN OR
EXECUT
E
THERE ARE TWO WAYS
TO WRITE A JAVA
PROGRAM:
1- TEXT EDITOR
(NOTEPAD).
2- JAVA IDE
(JCRAETOR).An integrated development
environment (IDE) is a programming
environment that has been packaged as
an application program, typically
consisting of a code editor, a compiler, a
debugger, and a graphical user
interface (GUI) builder. The IDE may
be a standalone application or may be
included as part of one or more existing
and compatible applications.
8. ENG. AHMED ELBADAWY - FALL 2016
8
WRITE
CODE
SAVE
CODE
COMPIL
E CODE
RUN OR
EXECUT
E
Saving java code has
two very important
rules:
1- you have to save the
file with the same class
(java program) name or
identifier.
2- the file extension must
be file name.java
9. ENG. AHMED ELBADAWY - FALL 2016
9
WRITE
CODE
SAVE
CODE
COMPIL
E CODE
RUN OR
EXECUT
E
A compiler is a special
program that processes
statements written in a
particular programming
language and turns them into
machine language or "code"
that a computer's
processor uses
(http://whatis.techtarget.com/d
efinition/compiler)
So generally, compiling
code means translating the
code instruction to the
language that the computer
can understand
(will discuss later in lecture 3)
10. ENG. AHMED ELBADAWY - FALL 2016
10
WRITE
CODE
SAVE
CODE
COMPIL
E CODE
RUN OR
EXECUT
E
The computer processor
executes the program
instructions then the user gets
the output
11. ENG. AHMED ELBADAWY - FALL 2016
11
public class firstlab
{
public static void main (String [] args)
{
System.out.print("HELLO JAVA");
}
}