The latest news for the java programmers that the Sun MicroSystems has released the Java SE 6 on Monday December 11. So go and grab your copy. It has been released with the promises to ease the complexities faced in the jdk 1.5. Here we at Roseindia.net is providing of each and every new features added in jdk 6 with running examples.
These are the major new Features in JAVA SE 6
in JSE 6
This section introduces you with the new exciting features of Java SE 6.
Changes in I/O
This is a new feature added in Java SE 6, which has the ability to read text from a terminal without having it echo on the screen through java.io.Console.
Java 6.0 New Features
As the name indicates collections is a group of objects known as its elements. Basically it is a package of data structures that includes ArrayLists, LinkedLists, HashSets, etc. A collection is simply an object that groups multiple elements into a single unit. It is also called as a container sometimes. It is used to store, retrieve, manipulate, and communicate aggregate data.
Introduction to Collections API
A collection is simply an object that groups multiple elements into a single unit. It is also called as a container sometimes. It is used to store, retrieve, manipulate, and communicate aggregate data.
Introduction to Collections Framework
In this section, you will know about the collection framework as well as its advantages and disadvantages.
Introduction to Collection Interfaces
The Collections Framework is made up of different sets of interfaces for storing and manipulating groups of data into a single unit. It consists of several interfaces, and classes that implements those interfaces, within the java.util package.
- Set Interface and SortedSet
- List and Queue Interface
- Map and SortedMap Interface
- Collection Implementations
- Collection Algorithms
- Custom Collection Implementations
Java 6.0 Collection Framework
Some of the new collections APIs have been introduced in Java 6.0.
Collections Framework Enhancement
In Collection framework, we are able to improve the performance hashing function that is used by java.util.HashMap. It provides some new Collection interfaces also.
Lets See How to Work With Collections Framework With the Help of Following Examples.
Navigable Map Example
In NavigableMap we use methods to return the key value pair like navMap.put(1, "January"); whereas in NavigableSet we use methods to return values.
Navigable Set Example
In the example below we have used NavigableSet method to sort the elements in ascending order, descending order, also to retrieve the element which is immediately greater than or equal to 35 etc.
In this section provides you an example to HashSet collection frame work. A HashSet is a set that doesn't allow duplicate elements and doesn't order or position its elements.
Linked List Example
This section discusses an example to demonstrate the various methods of List interface. We are using two classes ArrayList and LinkedList in the example code.
Tree Map Example
In the following example, we have used the TreeMap method, which stores its elements in a tree and orders its elements based on their values. Here in the example we have used the key of the element to show the values of the element.
Tree Set Example
In the following example, we have used the TreeSet collection, which is similar to TreeMap that stores its elements in a tree and maintain order of its elements based on their values.
Changes in jar and zip
Jar and zip support has been enhanced in JDK 6. In this, two new compressed streams have been added. These are java.util.zip.DeflaterInputStream and java.util.zip.InflaterOutputStream.
Java Web Start enhancements in version 6
The cache format of Java Web Start and Plug-In has been fully changed. All dialogs have been redesigned and consolidated between Java Web Start and Plug-In to be more user friendly.
JMX API Enhancements
Enhancements has been made to the JMX API in Java SE 6 like : JMX API now completely supports Generics, MXBeans have been added and much more?
Java Platform Debugger Architecture Enhancements
JVMDI has been deleted in JAVA SE 6 and JPDA has been added. Some new Methods are included like boolean boolean canGetInstanceInfo() and much more?
Java SE 6 Monitoring and Management Enhancements
API provided by JAVA SE allows you to monitor and manage the JVM in the package java.lang.management. JAVA SE 6 includes some enhancement to this API.
New Package java.util.spi in JDK 6
A new package Java.util.spi has been included in JAVA SE 6.
Networking features and enhancements in Java SE version 6.0
This feature include enhancement in networkInterface, support for Internationalized Domain Names, HTTP Negotiate Authentication and much more?
Enhancements in java.lang.Class and java.lang.reflect
Some new Methods are included in java.lang.Class like : getInterfaces(), getClasses(), getConsturctors(), getMethod(String, Class?) and much more?.
Enhancement in RMI for JDKTM 6
java.rmi.MarshalledObject now support generics
JAVA SE 6 Security Enhancements
JAVA SE 6 has added support for some security functionality: the XML Digital signature API and implementation, Smart Card I/O API. And much more?
Serialization Changes and Enhancements in JAVA SE Development Kit 6
The new method ObjectStreamClass.lookupAny now used to obtain an ObjectStreamClass instance for a non-serializable Class
JavaTM Virtual Machine Technology
DTrace support has include in Java SE 6 HotSpot VM. The hotspot provider makes available probes that can be used to track the lifespan of the VM, thread start and stop events
Scripting for the Java Platform
By using this Features developers integrate Java technology and scripting languages by defining a standard framework and application programming interface (API)
Leveraging Security in the Native Platform Using Java SE 6 Technology
The JAVA SE 6 provide a large set of security APIs. These Security APIs span a wide range of areas, including cryptography public key infrastructure, secure communication, authentication, and access control.
JAX-Web Services 2.0 With the Java SE 6 Platform
Most exciting new features of the JAVA SE 6 is support for the Java API for XML Web Services (JAX-WS), version 2.0.
This section contains collection of frequently asked questions(faqs) in interview or viva of Java.
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.