A seminar on
Advanced Programming in
Prepared By :
Creation of Java
Importance of java to internet
Migration from c++ to java
What java has removed from c++
New features added by Java
Basics of core Java
Basics of Advance Java
Creation of JAVA
At Sun Microsystems Inc in 1991. It took 18 months to develop the
first working version. This was initially called as “Oak” and
renamed as “Java” in 1995.
The original impetus was not the Internet, instead the
primary motivation factor was platform independent
The java platform differs from other platforms in that it is
a software only platform, that runs on the top of the h/w-
The java platform has two components:
Java Virtual Machine(JVM)
Java Application Programming Interface(Java API)
Why Java is Important to the Internet
Java has had a profound effect on the internet. Reason
is Java expands the universe of objects that can move
about freely in cyber space. In a network two very
broad categories of objects are transmitted between
the server and your PC:
Dynamic or Active programs.
Java’s Magic : the Byte Code
Byte code is highly optimised set of instructions designed
to be executed by the java run time system(JVM).
JVM is an interpreter for Byte code.
When a java program is translated into Byte code it is
easier to execute that program in a wide variety of
Migrating from C++ to Java
What Java has removed from C++
Perhaps the most biggest difference between Java &
C++ is that Java doesn’t support pointers. It doesn’t
exist in Java for this reason:-
Pointers are inherently insecure.
Few more of the most important omissions
Java doesn’t include structure & unions.
Java doesn’t support operator overloading.
Doesn’t include preprocessor nor does it support
Doesn’t support automatic type conversion that result in
loss of precision.
Doesn’t allow default arguments.
Although Java support constructors, it doesn’t have
destructors, it does however add finalize() function.
Java doesn’t support typedef.
It doesn’t allow goto & doesn’t have delete operator.
New features added by Java
Multithreading: allows two or more pieces of the same
program to execute concurrently.
There is no feature in C++ that directly corresponds to a
Java package. The closest similarity is a set of library
functions that use a common header file.
The Java interface is somewhat similar to C++ abstract
Java removes the C++ standard library replacing it with
its own set of API classes.
The Java Buzz Words
Some important concepts of core Java
Fundamentals of Packages
Java packages are the ways of grouping a variety of
classes and interfaces together. So that packages act as
container of classes.
packages are of two types:
User defined packages
Java.lang Java.util Java.awt Java.net Java.io Java.applet
Java.lang: these classes automatically imported and include
classes for primitive data types, strings, math functions.
Java.util: contains language utility classes such as vectors,
dates, random numbers.
Java.awt: set of classes for implementing Graphical User
Java.net: include classes for communicating with local
computers as well as internet servers.
Java.io: this package contains classes for input and output
Java.applet: this package include classes for creating and
Applets are small applications that are accessed on an
internet server, transported over the internet, automatically
installed and runs as part of a web document.
This applet begins with two important statements-
An Applet skeleton
An applet is a program that doesn’t contain the main()
method and contain the followings as basic structure.
An applet generally run by a web browser and carries out its
input/output by using Graphical User Interface supported by
Each applet class is to be a subset of predefined Applet class.
Concept of Advanced JAVA
Advanced Java covers—
JDBC Getting Started
JDBC API –
Part of JDK.
Enable Java Application to connect with a database.
Contain set of classes and interfaces that are used to connect
to a database.
Is a low level interface.
Can be used with both 2-tier and 3-tier architecture.
These are required to
Reduce the overhead on the server and network.
To take care of processing data on web server.
Java programs that can be deployed on a java enabled web server.
Used for dynamic connect to web page.
Efficient: Initialization code for a servlet is executed only once.
Robust: Provide all powerful features of java portable across web
Persistent: Increase the performance of a system by preventing
frequent data access.
Comparison between servlet and applet
Embedded in web pages.
Requires the browser to be java enabled.
Take a lot of time to download.
Don’t require the browser to be java enabled.
Execute on the webserver, thus helps to overcome
problems with download time.
It is a specification that enables one java virtual machine
to invoke methods in an object located in another JVM.
Is implemented on the middle tier of the 3-T architecture.
Facilitates the programmer to invoke distributed
components across a network environment.
Is an easy alternative to the complex server-socket
Programmers can solely concentrate in developing
Contain the objects whose methods are to be invoked
Creates several remote object and makes a reference of
these objects in the RMI registry.
RMI registry registers objects that are to be remotely
invoked by the client.
Get the reference of one or more remote objects from RMI
registry by looking up the object name.
Invoking the methods on the remote objects to access the
services of the remote objects.
JSP is an extended servlet.
Powerful technology to generate dynamic html on the web
or server side.
It allow the developer & designer to jointly work
simultaneously and to give a dynamic output to a client.
This technology also allows the segregation of static and
After the compilation of JSP it automatically converted to
Any changes made to the JSP (either by decoder or
designer) are automatically recompiled and reloaded
during consecutive request.
First time JSP server is very slower because it generates
A java bean is a s/w component that has been designed to be
reusable in a variety of different environments. There is no
restriction on the capacity of bean. It may perform a simple
function, checking the spelling of a document, or a complex
function such as forecasting the performance of a stock
A bean obtains all the benefits of java’s “write-once, run-anywhere”
A bean may register to receive events from other objects and can
generate events that are sent to other objects.