Академический Документы
Профессиональный Документы
Культура Документы
www.vibranttechnologies.co.in
Contact Us On :
www.vibranttechnologies.co.in
What is Java?
Features of Java
How Will Java Change My Life?
Java Applications and Java
Java Developer's Kit
Prepare and Execute Java
Write Once, Run Anywhere
Byte Code: Food for the VM
Java Application & Applet
Contact Us On :
www.vibranttechnologies.co.in
A programming language
Fully buzzword-compliant:
Contact Us On :
www.vibranttechnologies.co.in
Java: An Overview
James Gosling, Sun Microsystems,
February 1995.
According to Gosling:
An environment
A platform
A way of thinking
ok, whatever
Java is a phenomenon
Took the world by storm in 1995 when
introduced with the HotJava web Browser
Quickly integrated with Netscape browser
Contact Us On :
www.vibranttechnologies.co.in
Contact Us On :
www.vibranttechnologies.co.in
Contact Us On :
www.vibranttechnologies.co.in
Contact Us On :
www.vibranttechnologies.co.in
Stand-alone Applications
Applet
Midlet
Servlet
Switchlet
Contact Us On :
www.vibranttechnologies.co.in
Contact Us On :
www.vibranttechnologies.co.in
Contact Us On :
www.vibranttechnologies.co.in
source
(text)
compiler
bytecode
(aka. class file)
JVML
dynamic
loading
virtual machine
bytecode
interpreter
verifier
JIT
compiler
CPU
Contact Us On :
www.vibranttechnologies.co.in
compiled
code
Just-In-Time compiler
Translates bytecode into machine code at
runtime
1-time overhead when run initiated
Performance increase 10-30 times
Contact Us On :
www.vibranttechnologies.co.in
Small devices.
Reduces some VM features to fit resourceconstrained devices.
Smart cards.
It has least VM features.
Contact Us On :
www.vibranttechnologies.co.in
Contact Us On :
www.vibranttechnologies.co.in
Contact Us On :
www.vibranttechnologies.co.in
Contact Us On :
www.vibranttechnologies.co.in
Contact Us On :
www.vibranttechnologies.co.in
Compile
javac HelloWorld.java
Contact Us On :
www.vibranttechnologies.co.in
class HelloWorld
{ public static void main (String[] args)
{ System.out.println(Hello World!);
}
}
The notation class.method or
package.class.method is how to refer
to a public method (with some
exceptions).
Contact Us On :
www.vibranttechnologies.co.in
import java.applet.Applet;
import java.awt.Graphics;
public class HelloWorldApplet extends Applet {
public void paint(Graphics g) {
g.drawString(Hello World!, 5, 25);
}
}
Contact Us On :
www.vibranttechnologies.co.in
javac HelloWorldApplet.java
One file named HelloWorldApplet.class is
created if the compilation is succeeds.
Contact Us On :
www.vibranttechnologies.co.in
<html><head>
<title>Simple Hello Page</title>
</head>
<body>
Name of your applet class.
My Java applet says:
<applet code=HelloWorldApplet.class width=150 height=25>
</applet>
</body></html>
The browser will use a rectangle of width 150 pixels and height 25
pixels to display the applet within the other html.
Contact Us On :
www.vibranttechnologies.co.in
Java applets are part of the class hierarchy that can call methods
to display on a screen (within the browser window). One way to
draw on the screen is to call the method drawString from the
standard method paint.
The import statement allows the use of methods from
the Graphics class without the dot notation .
import java.awt.Graphics;
Contact Us On :
www.vibranttechnologies.co.in
Contact Us On :
www.vibranttechnologies.co.in