Ch1 Introduction to Java
Ch1 Introduction to Java
4
Features of Java
Desktop client
Portable
Interpreted
High performance
Multithreading
Dynamic
Monitoring and manageably
JDBC Row Set
5
Features of Java
Simple / Ease of Development
Java does not use pointers, preprocessor header files,
goto statement, operating overloading and multiple
inheritance and many others --- so simple
Object Oriented
It include all features of OOPs
Distributed
Java is designed as a distributed language for creating
applications on Networks.
Java applications can access remote objects on internet as
easily as they can do in a local system.
6
Features of Java
Robust
Java provides many safeguards to ensure reliable code.
It does compile time and run time checking for data
types.
It does garbage collection relieving the programming
virtually from all memory management problems.
It also provides exception handing, which captures the
errors and eliminates any risk of crashing the system.
7
Features of Java
Secure
Java systems verify the memory access and also ensure that no
viruses are communicated with an applet.
Absence of pointer in Java ensures that programs cannot gain
access to memory locations without proper authorizations.
Platform Independent
This is the most significant features of java.
Java programs can be easily moved from anywhere at anytime.
Change in operating systems and processors do not force any
changes in java programs . And so Java has become a popular
language for programming on Internet, which interconnects
different kinds of systems worldwide.
8
Features of Java
Desktop client
Java 2 provides enhanced features to meet the requirements of the
java desktop users. It provides an improved Swing look.
Portable
Java compiler generates byte code instructions that can be
implemented on any machine.
The size of the primitive data types is machine independent.
High performance
Java performance is impressive due to the use of byte – code and
multithreading.
JDBC Row Set
This sends data in a tabular format between the remote
components of a distributed enterprise application. 9
How Java is different from c++
Java is true object oriented language while C++ is basically
C with object – oriented extensions.
Java does not supports operator overloading
Java does not have template classes as in C++
Java has replaced multiple inheritances of classes with a
new feature called interface
Java does not use pointers
Java has replaced the destructor function with a finalize()
function.
There are no header files in java
Java does not support global variables. Every variable and
method forms part of a class 10
How Java is different from c++
Java does not support structures and unions
All non primitive data types are created using new operator.
Java adds a new right shift operator >>> which inserts zeros
at the top end.
The modulo division may be applied to float values in Java
which is not permitted in C/C++.
Java supports multithreading
Java supports automatic garbage collection and makes a lot
of programming problems vanish.
Java program do not use header files.
11
Java Applets and Internet
What is Java Bytecode ?
When the source code in the Java language is
complied, the Java ByteCode is created.
It is highly optimized code which is interpreted by
JVM.
The Java Virtual Machine is an abstract computer,
on which the byte code can execute.
The Java Virtual Machine becomes a middle level
between the byte code and any operating system.
12
Java Applets and Internet
Java programs that work on web pages are called Applets.
An applets is ByteCode that can distributed through the
World Wide Web and used in Web page.
We require Java – enabled web browser to execute the
bytecodes. Today, almost all web browser have come with
buit in java virtual Machine. And so the user who is surfing
the browser gets Java Virtual Machine by default.
So, following are the benefits of Java and Internet which
comes together
Use of more than one applet for web page
Applets can communicate with each others
13
Java and World Wide Web
Before java, the www was limited to the display of still
images and texts
Incorporation of Java into web pages has made it capable of
supporting animation, graphics, games and many other
special effects.
With the support of Java, web has become more interactive
and dynamic.
The three common kind of java programs used on WWW
are the web browsers.
HotJava
Netscape Navigator
Internet Explore
14
Java and World Wide Web
HotJava
It is the web browser developed by Sun Microsystems written entirely in
Java Language
HotJava is available for Solaris Platform, Windows 95, Windows XP and
Windows NT
HotJava is the first web browser to provide support for the java
language.
Netscape Navigator
It is the web browser developed by Netscape Communications
Corporation, is a general purpose browser that can run Java applets
It is available for Solaris, Windows 95, NT and Applet Macintosh
It provides features such as visual display of downloading process and
indication of number of bytes downloaded.
Internet explorer
It is the web browser developed by Microsoft for Windows 95, NT
and XP. 15
Java Support Systems
Operations of Java and Java enable browsers on internet
require a variety of support systems for delivering
information on the Internet
Sr. No Support System Description
1 Internet Connection Local computer should be connected to
the Internet
2 Web Server Accepts request and sends the required
infromation
3 Web Browser Provides access to WWW and runs Java
Applets
4 HTML Creates hypertext for the web
5 Applet tag For placing Java applets in HTML
document
6 Java code Used for defining Java APPLETS
17
Java Development Tools
Sr. Tool Description
No
1 appletviewer Enables to view Java applets without actually using a java –
compatible browser
2 javac Java Compiler, which translates Java source code to byte codes
files that the interpreter can understand
5 AWT package The Abstract Window Tool kit package contains classes that
import java.awt.*; implement platform independent GUI
6 Applet Package Includes a set of classes that allows to create Java applets 19
JAR files
The JAR (java Archive) tool is a java application that
combines multiple files into single JAR archive file.
JAR is a general – purpose archiving and compression tool,
based on ZIP and the ZLIB compression format.
20
Java Editors
Editors are simple text files. They generally highlight the
Java Syntax, indent for you, balance your parentheses and
braces, and let you compile from within the editor.
But they don’t write code.
There are 4 types of editors for Java Programming :
Multi - os editors
Emacs, Xemacs, JEdit
Windows editors
TextPad, UltraEdit,notepad
MacOS editors
BBEdit, SportCheck
Unix/Linux editors
Emacs, Eemacs, JEdit
21
Questions:
Java is pure object-oriented language Give one Reason
supporting the given argument
What is javap?
Why java is called as safer language compared to C++?
What is jdb?
Why jar is used in java?
Why java needs compiler and interprester?
What are java bytecodes?
What does the java API cosist?
What is JVM?
22
The End
23