JAVA TM Introduction
JAVA TM Introduction
JAVA TM Introduction
Java Introduction Java Features How Java Differs from other OO languages Build your first Java Program Summary
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 -The name that survived a patent search Java Authors: James , Arthur Van , and others
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 1990 Development Sun decided to developed special software that could be used for electronic devices. A project called Green Project created and head by James Gosling. Explored possibility of using C++, with some updates announced a new language named Oak The team demonstrated the application of their new language to control a list of home appliances using a hand held device. 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.
1991
1992
1993
Java Milestones
Year 1994 Development The team developed a new Web browser called Hot Java to locate and run Applets. HotJava gained instance success. Oak was renamed to Java, as it did not survive legal registration. Many companies such as Netscape and Microsoft announced their support for Java Java established itself as both 1. the language for Internet programming 2. a general purpose OO language. A class libraries, Community effort and standardization, Enterprise Java, Clustering, etc..
1995
1996
1997-
Java Features
Familiar, Simple, Small Compiled and Interpreted Platform-Independent and Portable Object-Oriented Robust and Secure Distributed Multithreaded and Interactive High Performance Dynamic and Extensible
Source Code Text Editor .java file Notepad, emacs,vi javac Compiler
JAVA INTERPRETER
(one for each different system)
Windows 95
Macintosh
Solaris
Windows NT
Java Compiler - Java source code (file with extension .java) to bytecode (file with extension .class) Bytecode - an intermediate form, closer to machine representation A interpreter (virtual machine) on any target platform interprets the bytecode.
Porting the java system to any new platform involves writing an interpreter. The interpreter will figure out what the equivalent machine dependent code to run
Core Classes
language Utilities Input/Output Low-Level Networking Abstract Graphical User Interface
Internet Classes
TCP/IP Networking WWW and HTML Distributed Programs
C++
Java
No Typedefs, Defines, or Preprocessor No Global Variables No Goto statements No Pointers No Unsafe Structures No Multiple Inheritance No Operator Overloading
Java Applications
jdb- The Java Debugger appletviewer -Tool to run the applets javap - to print the Java bytecodes javaprof - Java profiler javadoc - documentation generator javah - creates C header files
javac
javah
Header Files
java
jdb
Output
Hello Internet
// hello.java: Hello Internet program class HelloInternet { public static void main(String args[]) { System.out.println( Hello Internet ); } }
Program Processing
Compilation
# javac hello.java results in HelloInternet.class
Execution
# java HelloInternet Hello Internet #
} }
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
Java has emerged as a general purpose OO language. It supports both stand alone and Internet Applications. Makes the Web Interactive and medium for application delivery. Provides an excellent set of Tools for Application Development.