Академический Документы
Профессиональный Документы
Культура Документы
SCIENCE, BHOPAL
(SESSION 2014-2015)
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
Submitted To:
Head of Dept:
Submitted By:
vivek kumar
ACKNOWLEDGEMENT
The completion of this training work could have been possible with continued & dedicated
efforts & guidance of large number of faculty & staff members of the institute .I acknowledge
our gratitude to all of them. The acknowledgement however will be incomplete without specific
mention as follows
I wish to acknowledge my deep gratitude to Mr.Amrit Singh, teacher at CRISP for his
cooperation and guidance. I am also thankful to his Lab assistant that provided staunch support
throughout this training and helped me to complete the training successfully
Furthermore I would also like to acknowledge with much appreciation the crucial role of our
HOD Prof. Anurag Jain for this encouragement & providing all the facilities in the department
Finally, I would like to say that I am indebted to my parents for everything that they have done
for me. All of this would have been impossible without their constant support. And I also thank
to God for being kind to me and driving me through this journey.
Vivek kumar
0132cs111116
CERTIFICATE
This is to certify that the Mr. Vivek kumar student of Radharaman Institute of Technolohy &
science, Bhopal, B.E 7th semester (computer science), has completed his Vocational training at
CRISP Bhopal from
His overall performance & behavior during the training is found to be
Satisfactory.
Signature
Mr. Anurag Jain, HOD
0132cs111116
APPROVAL CERTIFICATE
This dissertation work entitled Industrial Training Report on J2SE submitted by Mr. Vivek
kumar is approved for the award of degree of Bachelor Of Engineering in Computer Science
and Engineering.
Internal Examiner
External Examiner
Date:
Date:
0132cs111116
CANDIDATE DECLARATION
Date:
vivek kumar
Enroll No: 0132CS111116
0132cs111116
INDEX
S. No
TOPIC NAME
PAGE NO.
Company Profile
Introduction To Java
Installation Of Java
10
Configuring Variable
11
13
Package
15
16
Inheritance
17
10
18
11
20
12
Interface
22
13
24
14
IDE
27
15
History of Java
40
16
Features of Java
43
0132cs111116
SIGN.
COMPANY PROFILES
Centre for Research and Industrial Staff Performanc (CRISP), Bhopal has been established
in the year 1997 as a Society under the Indo German Technical Cooperation agreement.
Ministry of MSME, Government of India was the line ministry for this project whereas the
Department of Technical Education & Skill Development, Government of Madhya Pradesh and
German Technical Cooperation agency (GTZ) were the implementation partners. It is
headquartered in Bhopal with national & international operations dedicated to human resource
development & organizational development. These activities are targeted at Government,
Industries, Academic Institutions, Developmental Organizations as well as the Civil Society.
The organization has excellent infrastructure in terms of sophisticated laboratories in the field of
Industrial Automation, Mechatronics, Production Technology, Information & Communication
Technology (ICT), Multimedia Technology etc. CRISP is one of the most preferred service
providers in the areas of Technical Vocational Education & Training (TVET), Training Institution
Management and Entrepreneurship development.
FEATURES: A nodal Centre for Department of Technical Education & Skill Development
Government of Madhya Pradesh for technical and management staff capacity building.
More than 500 delighted clients from Industries, Central & State Government
Organizations, Academia, Developmental Organizations etc.
A role model for German Technical Co-operation Agency (GTZ) for replicating CRISP
like successful Project in India and other countries.
Practicing professional & management principles in our operations.
Facilitating applications of e-Governance for State Govt. of Madhya Pradesh.
A strong team of qualified & experienced employees (more than 150) capable of
handling technical and educational projects within India & overseas.
AREA OF SPECIALIZATIONS: Manufacturing Technology (CNC Technology, CAD/CAM (Unigraphics, Pro-E, CATIA,
Solid Works & I-DEAS), AutoCAD.
Industrial Automation (PLC, Variable Frequency Drives, Field Instrumentation, MMI,
Hydraulics, Pneumatics).
Mechatronics: Mechanical, Electrical, Electronics, Instrumentation, IT.
Car Mechatronics.
Behavioral Sciences and Management (Leadership Development, Communication Skills,
Team Building etc.).
Information Technology (Application &
Software Development, Hardware &
Networking Training, Web Designing etc.).
Vocational Education & Training (Design & development of curriculum & study
materials, Train The Trainers, Instructors Training, Trade identification survey, impact
study etc).
Fashion, Interior & Graphic Designing
0132cs111116
Introduction to Java
With the invention of microprocessors, the world is scientifically developed with sophisticated
equipments, systems, and devices. Microprocessors are used in computers, televisions, and fax
machines. Even the hand-held devices such as pagers, PDAs (Personal Digital Assistant), and
cell phones make use of microprocessors. All these electronic devices are helpful because of
their communication capabilities. With the increasing capabilities and decreasing cost of
information processing and networking technologies, the network is growing rapidly for
transmitting information through electronic systems.
Internet is the network of networks between different types of computers located at
different places to transmit information. Information can reach to any place in the world quickly
at a cheaper rate through the Internet. Thus, the Internet has made the world a global village for
information exchange. The emerging infrastructure of electronic devices and interconnected
computer networks create an environment that presents new challenges to software industries.
for this emerging computing environment, Java process to be a well suited programming
language. it is found suitable for networked environments involving a great variety of computer
and devices.
Java has many characteristics that have contributed to its popularity:
Platform independence - Many languages are compatible with only one platform. Java
was specifically designed so that it would run on any computer, regardless if it was
running Windows, Linux, Mac, Unix or any of the other operating systems.
Simple and easy to use - Java's creators tried to design it so code could be written
efficiently and easily.
Multi-functional - Java can produce many applications from command-line programs to
applets to Swing windows (basically, sophisticated graphical user interfaces).
Java does have some drawbacks. Since it has automated garbage collection, it can tend to use
more memory than other similar languages. There are often implementation differences on
different platforms, which have led to Java being described as a "write once, test everywhere"
system. Lastly, since it uses an abstract "virtual machine", a generic Java program doesn't have
access to the Native API's on a system directly. None of these issues are fatal, but it can mean
that Java isn't an appropriate choice for a particular piece of software.
0132cs111116
Java and Open Source: In 2006 Sun started to make Java available under the GNU General Public License
(GPL). Oracle continues this project called OpenJDK.
Java Virtual machine : The Java virtual machine (JVM) is a software implementation of a computer that
executes programs like a real machine.
The Java virtual machine is written specifically for a specific operating system, e.g. for
Linux a special implementation is required as well as for Windows.
Java programs are compiled by the Java compiler into bytecode. The Java virtual machine
interprets this bytecode and executes the Java program.
0132cs111116
The Java runtime environment (JRE) consists of the JVM and the Java class libraries and
contains the necessary functionality to start Java programs.
The JDK contains in addition the development tools necessary to create Java programs.
The JDK consists therefore of a Java compiler, the Java virtual machine, and the Java
class libraries.
Installation of Java
Check installation
Java might already be installed on your machine. You can test this by opening a console
(if you are using Windows: Win+R, enter cmd and press Enter) and by typing in the
following command:
java -version
If Java is correctly installed, you should see some information about your Java
installation. If the command line returns the information that the program could not be
found, you have to install Java.
0132cs111116
usr/local(To paste to the usr/local directory, you have to be in root) so that every user can
use the java files. You can delete the downloaded zip file so that it doesn't take up space
on
your
drive.
Macintosh: The latest available JDK is automatically installed by the operating system.
Because Java for Macintosh is developed and maintained by Apple, in coordination with
Sun, the current version on the Macintosh may not be the current version that is available
Note on Editions
The JDK comes in three editions.
Java Standard Edition (JSE) This version is the basic platform for Java. The course will
focus on this edition.
Java Enterprise Edition (JEE) This edition is mainly for developing and running
distributed multitier architecture Java applications, based largely on modular software
components running on an application server. We will not be covering this version in the
course.
Java Micro Edition (JME) This edition is primarily for developing programs to run on
consumer applicances, such as PDAs and cell phones.
Configuring Variables
Before writing code, it is recommended that you set the Path variable on your system
so you can compile your code more easily.
0132cs111116
Add the path to the bin directory of where Java is installed on your hard drive. It should
probably be: C:\Program Files\Java\jdk1.6.0_20\bin unless you changed it during
installation.
Click OK
For Macintosh
Apple sets everything up for you. Sit back and relax.
The only drawback is that because Apple handles development and maintenance of Java
on the Mac, there is usually a delay from the time that a new version is released by Sun
and the time that the new version is released on the Mac. Also, getting the latest version
sometimes requires an operating system upgrade.
Oh well, you can't have everything.
Validate installation
Switch again to the command line and run the following command.
java -version
0132cs111116
Garbage collector
The JVM automatically re-collects the memory which is not referred to by other objects.
The java garbage collector checks all object references and find the objects which can be
automatically released.
While the garbage collector releases the programmer from the need to explicitly manage
memory the programmer still need to ensure that he does not keep unneeded object
references otherwise the garbage collector cannot release the associated memory.
Keeping unneeded object references are typically called memory leaks.
Classpath
The classpath defines where the Java compiler and Java runtime look for .class files to
load. This instructions can be used in the Java program.
For example if you want to use an external Java library you have to add this library to
your classpath to use it in your program.
Write, compile and run a Java program
0132cs111116
Select or create a new directory which will be used for your Java development. In this
description the path \home\vogella\javastarter is used. On Microsoft Windows your
might want to use c:\temp\javastarter. This path is called javadir in the following
description. Open a text editor which supports plain text, e.g. gedit under Linux or
Notepad
under
Windows
and
write
the
following
source
code.
Save
the source code in your javadir directory with the HelloWorld.java filename. The name
of a Java source file must always equals the class name (within the source code) and end
with the .java extension. In this example the filename must be HelloWorld.java
because the class is called HelloWorld.
javac HelloWorld.java
Afterwards list again the content of the directory with the ls or dir command. The
directory
contains now a file "HelloWorld.class". If you see this file you have
successfully compiled your first Java source code into bytecode.
You can now start your compiled Java program. Ensure that you are still in the jardir
directory and enter the following command to start your Java program.
java HelloWorld
The system should write "Hello World" on the command line.
0132cs111116
java HelloWorld
If you are not in the directory in which the compiled class is stored then the system
should
result
an
error
message
Exception
in
thread
"main"
java.lang.NoClassDefFoundError: test/TestClass
To use the class type the following command. Replace "mydirectory" with the directory
which contains the test directory. You should again see the "HelloWorld" output.
Package
Java groups classes into functional packages.
Packages are typically used to group classes into logical units. For example all graphical
views of an application might be placed in the same package called
com.vogella.webapplication.views.
0132cs111116
It is common practice to use the reverse domain name of the company as top level package.
For example the company might own the domain, vogella.com and in this example the Java
packages of this company starts with com.vogella.
Other main reason for the usage of packages is to avoid name collisions of classes. A name
collision occurs if two programmers give the same fully qualified name to a class. The fully
qualified name of a class in Java consists out of the package name followed by a dot (.) and
the class name.
Without packages, a programmer may create a Java class called Test. Another programmer
may create a class with the same name. With the usage of packages you can tell the system
which class to call. For example if the first programmer puts the Test class into package
report and the second programmer puts his class into package xmlreader you can
distinguish between these classes by using the fully qualified name, e.g. xmlreader.Test or
report.Test.
Class
Def.: Template that describes the data and behavior associated with an instance of that
class.
In Java source code a class is defined by the class keyword and must start with a capital
letter. The body of a class is surrounded by {}.
package test;
class MyClass {
}
The data associated with a class is stored in variables ; the behavior associated to a class
or object is implemented with methods.
A class is contained in a Java source file with the same name as the class plus the .java
extension.
Object
0132cs111116
The object is the real element which has data and can perform actions. Each object is
created based on the class definition.
Inheritance
A class can be derived from another class. In this case this class is called a subclass. Another
common phrase is that a class extends another class.
The class from which the subclass is derived is called a superclass.
Inheritance allows a class to inherit the behavior and data definitions of another class.
The following codes demonstrates how a class can extend another class. In Java a class can
extend a maximum of one class.
package com.vogella.javaintro.base;
class MyBaseClass {
0132cs111116
void hello(){
System.out.println("Hello from MyBaseClass");
}
package com.vogella.javaintro.base;
class MyExtensionClass extends MyBaseClass {
}
If a class extends another class it inherits the methods from its superclass. If it wants to
change these methods it can override these methods. To override a method you use the same
method signature in the source code of the subclass.
To indicate to the reader of the source code and the Java compiler that you have the intention
to override a method you can use the @override annotation.
The following code demonstrates how you can override a method from a superclass.
package com.vogella.javaintro.base;
class MyBaseClass {
void hello(){
System.out.println("Hello from MyBaseClass");
}
}
package com.vogella.javaintro.base;
Variable
Variables allow the Java program to store values during the runtime of the program.
0132cs111116
Methods
A method is a block of code with parameters and a return value. It can be called on the
object.
package com.vogella.javaintro.base;
Method can be declared with var-args. In this case the method declares a parameter which
accepts from zero to many arguments (syntax: type .. name;) A method can only have one
var-args parameter and this must be the last parameter in the method.
Overwrite of a superclass method: A method must be of the exact same return parameter
and the same arguments. Also the return parameter must be the same. Overload methods:
An overloaded method is a method with the same name, but different arguments. The
return type can not be used to overload a method.
Main method
0132cs111116
A public static method with the following signature can be used to start a Java
application. Such a method is typically called main method.
public static void main(String[] args){
}
Constructor
A class contains constructors that are invoked to create objects based on the class
definition. Constructor declarations look like method declarations except that they use the
name of the class and have no return type. A class can have several constructors with
different parameters. Each class must define at least one constructor.
In the following example the constructor of the class expects a parameter.
package com.vogella.javaintro.base;
public class MyConstructorExample2 {
String s;
public MyConstructorExample2(String s) {
this.s = s;
}
If no explicit constructor is defined the compiler adds implicitly a constructor. If the class
is sub-classed then the constructor of the super class is always implicitly called in this
case.
In the following example the definition of the constructor without parameters (also
known as the empty constructor) is unnecessary. If not specified the compiler would
create one.
package com.vogella.javaintro.base;
public class MyConstructorExample {
// Unnecessary, would be created by the compiler if left out
public MyConstructorExample() {
}
}
The naming conversion for creating a constructor is the following: classname
(Parameter p1, ..) {} .
Every object is created based on a constructor. This constructor method is the first
statement called before anything else can be done with the object.
Modifiers
0132cs111116
Access modifiers
There are three access modifiers keywords available in Java. public, protected and private.
There are four access levels: public, protected, default and private. They define how the
corresponding element is visible to other components. If something is declared public, e.g.
classes or methods can be freely created or called by other Java objects. If something is
declared private, e.g. a method, it can only be accessed within the class in which it is
declared. protected and default are similar. A protected class can be accessed from the
package and sub-classes outside the package while a default class can get only accessed via
the same package. The following table describes the visibility:
Class
Package
Subclass
World
Public
protected
no modifier
Private
Other modifiers
final methods: cannot be overwritten in a subclass
abstract method: no method body
synchronized method: threat safe, can be final and have any access control
native methods: platform dependent code, apply only to methods
strictfp: class or method
Import statements
0132cs111116
Static imports
Static import is a feature that allows members (fields and methods) which are defined in a
class with the public static access modifier to be used in Java code without specifying
the class in which the member is defined. The feature provides a typesafe mechanism to
include constants into code without having to reference the class that originally defined the
field.
Interface
Interfaces are contracts for what a class can do but they say nothing about the way in
which the class must do it. An interface is a type similar to a class. Like a class an
interface defines methods. An interface can have only abstract methods, no concrete
methods are allowed. Methods defined in interfaces are by default public and abstract
explicit declaration of these modifiers is optional. Interfaces can have constants which are
always implicitly public, static and final. A class can implement an interface. In this case
it must provide concrete implementations of the interface methods. If you override a
method defined by an interface you can also use the @override annotation. The
following code shows an example implementation of an interface and its usage within a
class.
package com.vogella.javaintro.base;
public interface MyDefinition {
// constant definition
String URL="http://www.vogella.com";
// define several method stubs
void test();
void write(String s);
}
package com.vogella.javaintro.base;
public class MyClassImplementation implements MyDefinition {
@Override
public void test() {
// TODO Auto-generated method stub
}
@Override
public void write(String s) {
// TODO Auto-generated method stub
}
0132cs111116
}
}
package com.vogella.javaintro.base;
If a variable should be defined as constant, you declare it with the static and the final
keyword. The static method runs without any instance of the class, it cannot directly
access non-static variables or methods.
0132cs111116
How to do it
package test;
package test;
public class MyNewClass {
private String var1;
}
package test;
public class MyNewClass {
private String var1;
var1 = para1;
// or this.var1= para1;
package test;
public class MyNewClass {
private String var1;
public MyNewClass(String
para1) {
var1 = para1;
// or this.var1= para1;
}
public void doSomeThing()
{
}
}
0132cs111116
What to do
How to do it
package test;
public class MyNewClass {
private String var1;
public MyNewClass(String
para1) {
var1 = para1;
// or this.var1= para1;
}
}
public void
doSomeThing2(int a, Person
person) {
}
public int
doSomeThing3(String a,
String b, Person person) {
return 5; // Any value
will do for this example
}
}
0132cs111116
What to do
How to do it
package test;
public class MyOtherClass {
String myvalue;
Dog dog;
public String
getMyvalue() {
return myvalue;
}
How to do it
String variable1;
Person person;
String array[];
var1 = 5;
pers1 = pers2;
ArrayList<Person> persons;
0132cs111116
What to do
How to do it
persons = new
ArrayList<Person>();
Use constructor
Add a constructor to your Person class which takes the first name, last name and the age
as parameter. Assign the values to your instance variables. Create in your main method
two objects of type Person and call the writeName method on it.
0132cs111116
setFirstName(String s) setter method. Change your main method so that you create one
person object and use the setter method to change the last name.
Create a new object called Address. The Address should allow you to store the address of a
person. Add a new instance variable of this type in the Person object. Also create a getter and
setter for the Address object in the Person object.
class Person {
String firstname = "Jim";
String lastname = "Knopf";
int age = 12;
voi
d writeName() {
0132cs111116
}
package exercises.exercise04;
Use constructor
package com.vogella.javastarter.exercises1;
class Person {
String firstName;
String lastName;
int age;
0132cs111116
void writeName() {
// Writes the firstname
System.out.println(firstName);
}
package com.vogella.javastarter.exercises1;
0132cs111116
class Person {
String firstName;
String lastName;
int age;
0132cs111116
void writeName() {
// Writes the firstname
System.out.println(firstName);
0132cs111116
}
package com.vogella.javastarter.exercises1;
0132cs111116
PostalCode(String postalCode) {
this.postalCode = postalCode;
0132cs111116
0132cs111116
}
package com.vogella.javastarter.exercises1;
class Person {
String firstName;
String lastName;
int age;
private Address address;
0132cs111116
0132cs111116
this.address = address;
}
void writeName() {
// Writes the firstname
System.out.println(firstName);
}
package com.vogella.javastarter.exercises1;
0132cs111116
System.out.println(pers.toString());
/*
* Actually System.out.println calls always toString, if you do not
* specify it so you could also have written System.out.println(pers);
*/
// I create an address
Address address = new Address();
// I set the values for the address
address.setCity("Heidelberg");
address.setCountry("Germany");
address.setNumber("104");
address.setPostalCode("69214");
address.setStreet("Musterstr.");
address = null;
// person is moving to the next house in the same street
pers.getAddress().setNumber("105");
0132cs111116
HISTORYOF JAVA
It is quite interesting to know the development of Java technology, which is widely accepted in
the area of networked/distributed computing. Java evolved from a project developing a language
for programming consumer electronic devices at Sun Microsystems, USA.
Suns Stealth Project in 1990 was aimed to do research in the area of application of
computers in the consumer electronics market. Bill Joy, James Gosling, Mike Sheridan, Patrick
Naughton (formerly the project leader of Suns Open Windows user environment), and several
other individuals discussed the ideas for the Stealth Project in January 1991.The vision of this
project was to develop smart consumer electronic devices that could all be centrally controlled
and programmed from a handheld-remote-control-like device. The Stealth group began to work
to achieve this goal. It was realized that a platform-independent development-environment was
needed.
Green Project was initiated by Patrick Naughton, Mike Sheridan, and James Gosling of
Sun Microsystems in 1991 (Members of the Stealth Project, which later became known as the
Green Project) The tasks of the project were divided amongst the members of Green Project.
Mike Sheridan concentrated on business development, Patrick Naughton worked on the graphics
system, and James Gosling was to identify the appropriate programming language for the Green
Project. Even though creating a new language was not the aim of Green Project, a new language
was created as a programming tool in this project since C++ was found unsuitable for the project.
An intelligent remote control called *7 (Star Seven) was delivered as the first product of
Green Project in 1992. It is a PDA- like device comprising of a new language oak, an operating
system called GreenOS, user interface, and hardware. This device was quite impressive to Sun
0132cs111116
Executives. But no customer was interested in this project. The market was not conducive to this
type of device in the consumer electronics industry.
The new language Oak was created by James Gosling, a Green Team member,
specifically for *7. Gosling named the new language Oak because that name was struck while
looking at an oak three outside of his office window. The name Oak was later renamed to Java
in order to avoid legal issues since Oak was the name of an existing language.
In November 1992, the Green Project was incorporated under the name FirstPerson. In
1993. Time-Warner was demanding for proposals for set-top box operating systems and videoon-demand technology with an objective of sending the data to consumer all over the country for
display on the television sets. At the same time (1993(, NCSA released the first graphical web
browser Mosaic 1.0, an easy-to-use front end to the World Wide Web.
When FirstPerson was bidding on the Time-Warner TV trial based on video-on-demand
technology, Time-Warner chose Silicon Graphics, Inc. (SGI) over Sun. Hence, half of the
members of FirstPerson left for SGI and the remaining members continued to work at Sun.
Mosaic web browser revolutionized peoples perceptions. The remaining member of
FirstPerson returned to work on Java (Oak was renamed Java) to develop Java-based web
browser. FirstPerson was dissolved gradually. Naughton and Jonathan Payne developed
WebRunner (named after the movie Blade Runner). Later WevRunner was officially announced
as the HotJavaTM browser in 1994. This was the turning point for Java. At that time the World
Wide Web changed the face of Internet and it was winning the race on Internet.
Arthur Ban Hoff implemented the Java compiler in Java itself whereas Gosling
implemented it in C. The Java compiler, written in Java made the people to accept Java as a fullfeatured language.
Sun Microsystems officially announced Java environment at Sun World95 on May 23,
1995. Java entered into the mainstream of the Internet after a struggle for about four years.
Netscape Communications incorporated Java into its web browser Netscape Navigator. Within a
decade, Java was destined to be the most overreaching technology in the Internet. Java was not
restricted to the Internet alone. The initial goal of Sun was also achieved by using Java
technology in interactive set-top boxes, hand-held devices and other consumer electronics
products.
Sun released the first version 1.0 of Java in 1996. Java is an object-oriented programming
language which evolved from C++. It is also a high-level programming language. The different
forms of Java versions are discussed in the next section.
Year
1990
History of Java
Java - Versions and Features
Sun Microsystems started Stealth project supporting application of computers
in the consumer electronics market.
0132cs111116
1991
1992
1993
1994
1995
1996
1997
1998
2000
2002
2004
2006
2008
The Green project started with the members of Stealth project such as James
Gosling, Patrick Naughton, and Mike Sheridan. A new programming
language, called Oak was created by Gosling.
An intelligent remote control called StarSeven was delivered. The Green
Project was incorporated was incorporated under the name FirstPerson.
Mosaic Web browser was introduced in the world of Internet.
HotJava Web browser was announced by Sun Microsystems.
Oak was renamed as Java. Sun officially announced Java technology.
Sun released the first version 1.0 of Java. Core Language features supporting:
I/O facility, Utilities, Network Programming, User Interface AWT, Applets,
and Multithreading.
Sun released JDK1.1 by including new features such as addition of inner
classes to the language and capabilities such as JavaBeans, JDBC(Java Data
Base Connectivity), and RMI (Remote Method Invocation).
Java 2 Platform, Standard Edition (J2SE)1.2, code named as Playground, was
released. It replaced JDK and distinguished the base platform from j2ee (Java
2 Platform, Enterprose Edition) and J2ME (Java 2Platform, Micro Edition).
The key features include Swing graphical API, Java IDL (Interface Definition
Language) to support CORBA interoperability. They also added Collections
framework to support various data structures. For the first time, JVM was
equipped with a JIT (Just-in-Time) compiler.
J2SE 1.3, code named as Kestrel, was released with key features such as
JavaSound API to support audio operations (e.g., audio playback and
capture/recording, mixing, sequencing, and synthesis), Java Naming and
Directory Interface (JNDI), and Java Platform Debugger Architecture (JPDA).
H2SE 1.4, code named as Merlin, was released with key features such as (a)
image I/O API for manipulating images in formats like JPEG and PNG, (b)
integrated XML parser and XSLT processor (JAXP), integrated security and
cryptography extensions, (c) Java Web Start supporting deployment of Java
software applications over the network.
J2SE 5.0, code named as Tiger, was released with enhancement of Java
platform and inclusion of a number of significant new language features such
as Generics, Enhanced for Loop, Autoboxing/Unboxing, Typesafe Enums,
Varags, Static Import, and Metadata supporting declarative style programming
annotation of source code.
Java SE 6.0, code named as Mustang, was released with enhancement of
performance in Swing, JDBC 4.0 support, Java Compiler API, Upgrade of
JAXB to version 2.0, including integration of a StAX parser, support for
pluggable annotations, and many GUI improvements.
Java SE 7.0, code named as Dolphin, with native support for XML
recognizing its foundation for Web services.
0132cs111116
FEATURES OF JAVA
According to Sun, Java is defined as a simple, object-oriented, distributed, interpreted, robust,
secure, architecture neutral, portable, high performance, multithreaded, and dynamic
programming language and platform.
Java is simple because the syntax of well-known languages such as C and C++ are used with
modifications meant for simplification and improvement. It is easy to read and write Java code if
the reader is familiar with C/C++.
Almost everything in Java is centered on creating objects, manipulating the objects and making
objects work together. Only the primitive operations and data types are at the sub-object level.
Hence Java is an object-oriented programming language.
An application can be distributed in many systems which are connected together. Since
networking capability is incorporated in Java, the data/file can be sent across many systems to
run the application.
Java is robust because it is more reliable. It ensures the reliability by providing early checking
for possible errors. It eliminates error-prone constructs such as pointer. It eliminates error-prone
constructs such as pointer. It also supports runtime error handling.
Java programs are compiled to a byte code format that can be read and run by interpreters on
many platforms including Windows, Linux, etc. Hence, it is architecture neutral. Because of this
feature it is portable to new hardware and operating systems.
0132cs111116
Although the speed of execution of Java programs is slower compared to C/C++ programs, Java
is meant for distributed applications. Whenever the file/data is transmitted from one system to
another, the performance is not affected. Hence, it is having high performance.
Java supports multithreaded programming to perform several tasks simultaneously. Any code can
be loaded without recompilation at runtime. Hence it is dynamic.
0132cs111116