01 Introduction Java
01 Introduction Java
Unit objectives
Aftercompleting this unit, you should be
able to:
Describe the history and properties of the Java
programming language
Explain the Java execution model, including the
use of bytecode and the Java virtual machine
Outline the types of programs and components
that can be built using Java
What is Java?
Javais an object-oriented programming
language developed by Sun Microsystems
Java has a set of standardized class
libraries that support predefined reusable
functionality
Javahas a runtime environment that can
be embedded in Web browsers and
operating systems
1
2025/2/21
Goals of Java
Javawas developed to solve several
problems with existing languages
These issues had an important influence on
its development:
Object-orientation
Portability
Performance
Security
Internationalization
Distributed computing
Dynamic systems
Network capable
Java supports the development of distributed
applications
Some types of Java applications are designed
to be accessed through a Web browser
2
2025/2/21
Secure
Java authentication is based on public-key
encryption methods
Java’s pointer model protects private data in
objects and prevents unauthorized applications
from accessing data structures
3
2025/2/21
Java evolution(1/2)
Java is a relatively young language
It has been in use since 1995
It was originally designed for consumer
electronic devices(TV, VCR, Freeze, Washing
Machine, Mobile Phone)
Internet and Web was just emerging, so Sun
turned it into a language of Internet
Programming.
It allows you to publish a webpage with Java
code in it.
4
2025/2/21
Java evolution(2/2)
11
12
5
2025/2/21
13
Use of Java
Java can be used to build programs and
software components
Programs are stand-alone entities that can
run on the Java virtual machine
Applications
Applets
6
2025/2/21
Programs
Application
A stand-alone program that can access system
resources such as files
Does not need to run in a Web browser
Is explicitly invoked through the command line or
menu selection
The method main() is the entry point for an
application
Applet
A Java program that is embedded within a Web
page;almost always graphical
Security limits access to system resources
Code executes on the client inside a Web browser
15
Components(1/2)
Servlet
Handles requests from the Web browser and
returns responses
Creates dynamic content on the server
Runs inside an application server
16
7
2025/2/21
Components(2/2)
JavaBeans
Java code that has its properties, methods, and
events exposed to promote reuse among
developers
Reusable software component that can be
manipulated visually in a builder tool
17
Demo
A Simple Java Program
(GUI) Displaying Text in a Message Dialog Box
18
8
2025/2/21
19
20
9
2025/2/21
21
Checkpoint
1. What is the JVM and what does it do?
2. What is bytecode?
3.What is the difference between a
program and a component?
23
10
2025/2/21
Unit summary
In this module, you should have learned to:
Describe the history and properties of the Java
programming language
Explain the Java execution model, including the
use of bytecode and the Java virtual machine
Outline the types of programs and components
that can be built using Java
24
11