introduction to java kiyeol ryu java programming language
Post on 19-Dec-2015
272 views
TRANSCRIPT
Introduction to Java
Kiyeol Ryu
Java Programming Language
Java Programming Language
2
The Overview of Java
Table of Contents
• Brief History • What is Java• Java Applets and Applications• Java Programming Environment
Java Programming Language
3
The Overview of Java
Brief History
• 1991 Green Project (Sun Micro Systems)
– Comsumer Electronics • 1991 Oak language (Jav
a)• 1992 *7 - First Product• 1993 CableTV Box - fail • 1994 WWW 에 적용• 1994 HotJava Browser• 1995 Sun World 95 • 1996 JDK 1.0.2• 1997 JDK 1.1• 1998 JDK 1.2
– (J2SE SDK 1.2)
• 2000 J2SE SDK 1.3• 2002 J2SE SDK 1.4
• 1989 WWW (CERN) concept
• 1993 Mosaic (NCSA)• 1993 Netscape
M. Adressen, J. Clark
• 1995 Netscape Licensed Java
• 1996 MicroSoft Licensed Java
• 1998 Motorola Licensed Java
Java Programming Language
4
The Overview of Java
What is Java
• simple• object-oriented• distributed• interpreted• robust• secure• architecture neutral• portable• high-performance• multithreaded• dynamic
Ref: J. Gosling, et. al., The Java Language, A White Paper, Sun Microsystems,
1994
Java Programming Language
5
The Overview of Java
Java is Simple
• The syntax of Java is a cleaned-up version of the syntax for C++.
– header files– pointer– unions– operator overloading– virtual base classes– typedef– stuct– explicit memory management– etc.
C++C
Java
Java Programming Language
6
The Overview of Java
Java is Object-Oriented
• Models real world entities as objects• Abstracts out data as classes • Reuses classes through inheritance
Java Programming Language
7
The Overview of Java
Java is Distributed
• Extensive TCP/IP networking capabilities• Interactivities with protocols to retrieve
information such as HTTP, FTP• Ease of accessing remote files
Java Programming Language
8
The Overview of Java
Java is Interpreted
• The java interpreter can directly execute instructions in its object code.
• Java bytecode• Architecture-neutral
Java Programming Language
9
The Overview of Java
Java is Robust
• No pointer• Array bounds checking• Exception handling• Byte code verification
Java Programming Language
10
The Overview of Java
Java is Secure
• With robustness• Bytecode verifier
• Class loader
• Sandbox model
• Digital signature
Java Programming Language
11
The Overview of Java
Java is Architecture Neutral
Java Source
Java Compiler
Java Byte Code
network
Bytecode
Verifier
Class
Loader
JIT compiler
Interpreter
Runtime
hardware
Compile time
Runtime
Java Programming Language
12
The Overview of Java
Java is Portable
• Architecture independent
• Ints are always Ints and are always 32-bits 2’s
complemented integers.
• User interfaces via an abstract window system
so the windows can be implemented on UNIX,
PC and Mac
Java Programming Language
13
The Overview of Java
Java is Multithreaded
• Many simultaneous activities in “one” program
• Better interactive performance
• Better real-time behavior
Java Programming Language
14
The Overview of Java
Java is Dynamic.
• Code can be added to a running program – useful in evolving environment
• Reflection capability– to analyze objects in runtime
Java Programming Language
15
The Overview of Java
Applying Java
• Java Application– Stand-alone program– Java interpreter executes applications
• Java Applet– Java code embedded in HTML documents– Java-enabled browser executes(interprets) applets
• Java Servlet– Web component that generates dynamic content– Run by a web server
• Java Server Page(JSP)– To develop dynamic web pages– a JSP page is an HTML page that contains java code– Run by a web server
Java Programming Language
16
The Overview of Java
Java Application
• Sample application
class HelloWorldApp {
public static void main (String args[]) {
System.out.println (“Hello World!”);
}
}
Java Programming Language
17
The Overview of Java
Compile and Execute
• Java compiler generates Java bytecode
• Java interpreter executes Java bytecode
Java Program
Java Classes(Bytecodes)
Java Compiler
Java Interpreter
Results
Java Programming Language
18
The Overview of Java
Java Applet
• Sample HTML
<html>
<applet code=HelloWorld.class width=100
height=100 >
</applet>
</html>
WebBrowser
Applet(Java classes)
HTML
Web Server
1. load HTML2. load applet3. run applet
1
2
Java Programming Language
19
The Overview of Java
Java Programming Environment
• Java 2 Standard Edition(J2SE) SDK
Java Programming Language
20
The Overview of Java
Advanced Java Technology
• Java Beans• Java IDL• Jini technology• Java Message System(JMS)• Enterprise Java Beans(EJB)• Java Server Pages(JSP)• ...