java overview-unit I
java overview-unit I
EVOLUTION
Ms.C.Mohana Priya
M.Sc(CT).,M.Phil.,SET.,
Asst Prof,
Dept of Computer Applications,
Tiruppur Kumaran College for Women,
CONTENTS
Java Introduction
Java Features
How Java Differs from other OO languages
Java and the World Wide Web
Java Environment
Build your first Java Program
Summary and Reference
JAVA - AN INTRODUCTION
Java - The new programming language developed by Sun
Microsystems in 1991.
Originally called Oak by James Gosling, one of the inventors
of the Java Language.
Java is an island of Indonesia where the first coffee was
produced (called java coffee).
It is a kind of espresso bean. Java name was chosen by
James Gosling while having coffee near his office.
Java is really “C++ -- ++ “
JAVA INTRODUCTION
Originally created for consumer electronics (TV,
VCR, Freeze, Washing Machine, Mobile Phone).
Java - CPU Independent language
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.
JAVA MILESTONES
Year Development
1990 Sun decided to developed special software that could be used for
electronic devices. A project called Green Project created and head
by James Gosling.
1991 Explored possibility of using C++, with some updates announced a
new language named “Oak”
1993 The World Wide Web appeared on the Internet and transformed the
text-based interface to a graphical rich environment. The team
developed Web applets (time programs) that could run on all types
of computers connected to the Internet.
JAVA MILESTONES
Year Development
1994 The team developed a new Web browsed called “Hot Java” to locate
and run Applets. HotJava gained instance success.
1995 Oak was renamed to Java, as it did not survive “legal” registration.
Many companies such as Netscape and Microsoft announced their
support for Java
1996 Java established itself it self as both 1. “the language for Internet
programming” 2. a general purpose OO language.
Hardware and
Programmer
Operating System
JAVA COMPILER
(translator)
JAVA INTERPRETER
(one for each different system)
C++
C Java
JAVA AND C
No sizeof,typedef
No struct and union
No type modifiers auto,extern,register,signed
No preprocessors
No void keyword
Java adds instanceof,break,continue
JAVA BETTER THAN C++ ?
No Typedefs, Defines, or Preprocessor
No Global Variables
No Goto statements
No Pointers
No Unsafe Structures
No Multiple Inheritance
No Operator Overloading
Java replaced destructor with finalize() function
No header files
JAVA AND INTERNET
Stand-alone applications
Web applications (applets)
Applet-
A program embedded in a web page , to be run when the
page is browsed .
A program that contains no “main” method
APPLETS V/S APPLICATIONS
Interactive WWW
Flashy animation instead of static web pages
Applets react to users input and dynamically change
Display of dynamic data
WWW with Java
POWER OF JAVA AND THE WEB
Text Editor
Java Source
javadoc HTML Files
Code
javac
java jdb
Output
LET US TRY OUT
Compilation
# javac hello.java
results in HelloInternet.class
Execution
# java HelloInternet
Hello Internet
#
SIMPLE JAVA APPLET
//HelloWorld.java
import java.applet.Applet;
import java.awt.*;
}
}
CALLING AN APPLET
<HTML>
<TITLE>HELLO WORLD APPLET</TITLE>
<HEAD>THE HELLO WORLD APPLET</HEAD>
<APPLET CODE=“HelloWorld.class” width=500 height=500>
</APPLET>
</HTML>
APPLET EXECUTION
Using AppletViewer
Using Browser
SUMMARY