01 Java Programming Language
01 Java Programming Language
) Characteristics of Java
History
) James Gosling
) Oak project
) Java, May 20, 1995, Sun World
) HotJava
– The first Java-enabled Web browser
) Java version
– JDK 1.1, 1.2, 1.3, 1.4beta
) Java conference
– JavaOne
Characteristics of Java
) Java is simple
) Java is object-oriented
) Java is distributed
) Java is interpreted
) Java is robust
) Java is secure
) Java is architecture-neutral
) Java is portable
) Java’s performance
) Java is multithreaded
) Java is dynamic
JDK Versions
) JDK 1.02 (1995)
) JDK 1.1 (1996)
) Java 2 SDK v 1.2 (JDK 1.2, 1998)
) Java 2 SDK v 1.3 (JDK 1.2, 2000)
) Java 2 SDK v.13.1
) Java 2 SDK v.1.4beta
Java IDE Tools
) Borland’s JBuilder (RAD)
– http://www.borland.com/jbuilder/
) Microsoft Visual J++
– http://msdn.microsoft.com/visualj/
) Visual Café (RAD)
– http://www.webgain.com/products/visual_cafe/
) Jfactor by Rouge Wave
– http://www.rougewave.com
Java IDE Tools
) Sun Java Forte (IDE)
– http://www.sun.com/forte/ffj/
) IBM Visual Age for Java (RAD)
– http://www-3.ibm.com/software/ad/vajava/
Getting Started with Java
Programming
)A Simple Java Application
) Compiling Programs
) Executing Applications
)A Simple Java Applet
) Viewing Java Applets
) Applications vs. Applets
A Simple Application
Example 1.1
//This application program prints Welcome
//to Java!
public class Welcome
{
public static void main(String[] args)
{
System.out.println("Welcome to Java!");
}
}
Compiling Programs
) On command line
– javac file.java
Java Source
File
Compiler
Bytecode
Executing Applications
) On command line
– java classname
Bytecode
WelcomeApplet.html
<html>
<body>
<applet code="WelcomeApplet.class"
width = 100 height = 40>
</applet>
</body>
</html>
Viewing Java Applets
Applet
Example:
appletviewer WelcomeApplet.html
Security Restrictions on Applets
) Applets are not allowed to read from, or write to,
the file system of the computer viewing the
applets.
) Applets are not allowed to run any programs on
the browser’s computer.
) Applets are not allowed to establish connections
between the user’s computer and another
computer except with the server where
the applets are stored.
Author’s supplemental materials
) Web site:
http://www.cs.armstrong.edu/liang/intro3e.ht
ml
) Inclusions:
– Interactive Self Test
– Solutions to even-numbered programming exercises
– Example source code
) How to obtain, install, set path for Java 1.3, and
compile and execute Java codes
– http://www.cs.armstrong.edu/liang/intro3e/installjdk13.
html