Professional Documents
Culture Documents
PROGRAMMING
CHAPTER 2
NEW SHORES
S I VA S A K T H I B
HISTORY OF JAVA
• 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 is really “C++ -- ++ “
HISTORY OF JAVA – CONT.
Originally created for consumer Java - CPU Independent Internet and Web was just It allows you to publish a
electronics (TV, VCR, Freeze, language emerging, so Sun turned it into a webpage with Java code in it.
Washing Machine, Mobile language of Internet
Phone). For PDA Programming.
HISTORY OF JAVA – CONT.
• What’s in a name!
• Oak should support
Platform Independent
Extremely reliable
Compact
HISTORY OF JAVA – CONT.
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”
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.
1997- A class libraries, Community effort and standardization,
Enterprise Java, Clustering, etc..
HISTORY OF JAVA – CONT.
JAVA MILESTONES
Year Development
1995 “JAVA 1.0” –WRITE ONCE RUN ANYWHERE (WORA)
2006 & JAVA become open source under GNU General Public
2007 Licence(GPL)
JAVA FEATURES
SUN WHITE PAPER DEFINES JAVA AS:
THREADED DYNAMIC
JAVA FEATURES –
CONT.
• Familiar, Simple, Small
• Object-Oriented
• Distributed
• Platform-Independent and Portable
• Compiled and Interpreted
• Architecture Neutral
• Robust and Secure
• Multithreaded and Interactive
• High Performance
• Dynamic and Extensible
• High Performance
• Multimedia support
JAVA FEATURES – CONT.
JAVA INTERPRETER
(one for each different system)
• Java Compiler - Java source code (file with extension .java) to bytecode (file with
extension .class)
• The interpreter will figure out what the equivalent machine dependent code to run
JAVA FEATURES – CONT.
• Security
Security as part of design
Java compiler,interpretos,JRE carefully designed,loss of data,virus free,tamper free programs-
uses public key encryption method
• Robust
Java is strong-strong memory allocation method,garbage collection mechanism
Powerful exceptional handling and type checking
JRE does many checks on byte codes
JAVA FEATURES – CONT.
• Multi threading
capability to support multiple tasks-server to serve multiple clients,mp3 file and surf the web
• Dynamic and Extensible
Dynamically links new class libraries, methods and objects from C and C++
• High Performance
with interpreter inside JVM –make it slower than c and c++
So Just In Time(JITcompiler) as a part of JVM-remembers the machine code sequence- is
introduced to improve the speed
Java supports the multimedia –images,sounds and animation
OVERLAP OF C, C++, AND JAVA
C++
C Java
JAVA BETTER THAN C++ ?
?
• No Goto statements
• No Pointers
• No Unsafe Structures
• No Multiple Inheritance
• No Operator Overloading
• No Automatic Coercions
• No Fragile Data Types
OBJECT ORIENTED LANGUAGES -A COMPARISON
Hello Java
<app=
“Hello”> The Internet
Hello
SIGNIFICANCE OF DOWNLOADING APPLETS
• Interactive WWW
• Flashy animation instead of static web pages
• Applets react to users input and dynamically change
• Display of dynamic data
• WWW with Java - more than a document publishing medium
• http://www.javasoft.com/applets/alpha/applets/StockDemo/
standalone.html
POWER OF JAVA AND THE WEB
• Basic Tools (javac, java, javadoc, apt, appletviewer, jar, jdb, javah, javap, extcheck)
• Security Tools (keytool, jarsigner, policytool, kinit, klist, ktab)
• Internationalization Tools (native2ascii)
• Remote Method Invocation (RMI) Tools (rmic, rmiregistry, rmid, serialver)
• Java IDL and RMI-IIOP Tools (tnameserv, idlj, orbd, servertool)
• Java Deployment Tools (pack200, unpack200)
• Java Plug-in Tools (htmlconverter)
• Java Web Start Tools (javaws)
• These tools are the foundation of the JDK. They are the tools you use to create and build
applications.
• Javac- The compiler for the Java programming language.
• Java- The launcher for Java applications. In this release, a single launcher is used both for
development and deployment.
• Javadoc-API documentation generator.
JDK DIRECTORY STRUCTURE
PROCESS OF BUILDING AND RUNNING JAVA
PROGRAMS
Text Editor
Java Source
javadoc HTML Files
Code
javac
java jdb
Outout
JAVA API
• API is pre written java code that can be used by other programmers to create java applications-
classes are grouped into packages
• JAVA API is set of huge number of classes and methods grouped into packages and included in
JDK
• Package should be included to write and use the classes
• Linked list in C –LxinkedList lass
JAVA VIRTUAL MACHINE
• https://www3.ntu.edu.sg/home/ehchua/programming/howto/JDK_Howto.html
ADVANTAGE OF JAVA