Professional Documents
Culture Documents
Java I Lecture 1.pps
Java I Lecture 1.pps
“Java is C without
the Guns and
Knives.”
Java I--Copyright © 2000-2004 Tom Hunter
Java Architecture
• By now, Java itself has matured into its 3rd
version, named Java 2. This course is based
on Java 2. The most current is Java 2 (1.5.1)
• Java is Object-Oriented--that means
everything in the language behaves like an
object.
• What exactly that means will be explained
in the coming weeks.
Java I--Copyright © 2000-2004 Tom Hunter
Java Architecture
Java’s Architecture comes from four
separate but intertwined technologies:
• the Java Programming Language
• the Java class file format
• the Java API, or Application Programming Interface
• the Java Virtual Machine
Run-Time
Hello.java Environment
The Java PlatformJava I--Copyright © 2000-2004 Tom Hunter
Java Architecture
C object module
compiled into
machine language
“Write Once,
Run Anywhere”.
SANDBOX
Hello.java
Hello.class
is called a class.
Applications
Applets
Now
The ouris Application
double
This theslashes is complete.
denote
class name. We have
a “C++”-style added the
comment.
method
Every“main”.
Everything single bitAll
on the of methods
linecode
afterintheare
Java lower
double case.
mustslashes
sit main
in curly is a
is brackets.
special
Classmethod--it
ignored by
names are actually
the compiler. runs the program.
capitalized.
Words Inwithin the name are
any application, youalso
are capitalized.
always guaranteed
thatThis Java main
method program must
will run.be saved in a file with the exact
same name--matching the upper case--as you see in blue
above: HelloWorld.java
Java I--Copyright © 2000-2004 Tom Hunter
A Java Application
C:\>javac HelloWorld.java
C:\>
C:\>java HelloWorld
Hello World!