Highlights of J2SE 5.0 - Golpo Community Forum
Golpo Community Forum   

Go Back   Golpo Community Forum > Misc. > Tech-Talk & Technical Help

Tech-Talk & Technical Help Talk & Ask Anything About Technology.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-23-2006, 06:03 PM
Icy's Avatar
Icy Icy is online now
Icy is in love with depression_within
bujhchi!!!
Developer
Gender: Male
My System
 
Posts: 22,924
Threads: 306
Reputation: 5
Last Online: 12-03-2008 04:09 PM
Join Date: Dec 2005
Location: /dev/null/
Blog Entries: 3
Icy is an unknown quantity at this point
Send a message via MSN to Icy
Cool Highlights of J2SE 5.0


Metadata: Additional data or annotations can be associated with classes, interfaces, methods and fields. This can be read by annotation tools or at runtime through Java Reflection API. This can be used for generating additional source code or for providing additional debugging information.
Code:
@debug(devbuild=production,counter=1) public void testMethod()
Generic Types: Earlier version’s Collection API stored the values as the instances of ‘OBJECT’ and so required type casting while fetching the objects. The mismatch of data types therefore could not be discovered until runtime. This is now replaced with a possibility to declare the Collection with <> notation that will detect the mismatch of data types at compile time.
Code:
ArrayList<Integer> list =  new ArrayList<Integer>();
list.add(0, new Integer(42));
int total = list.get(0).intValue();
Auto-boxing and auto-unboxing of primitive type variables: The conversion between primitive type variables and their object based counterparts is left to the compiler now and will not require extra coding effort.
Code:
ArrayList<Integer> list = new ArrayList<Integer>();
list.add(0, 42);
int total = list.get(0);
Enhanced for Loop: The enhanced for loop will now replace the traditional iteration code used to traverse a collection. There is no need of looping code and type casting as the collection objects will be converted to generic types.
Code:
ArrayList<Integer> list = new ArrayList<Integer>();  
for (Integer i : list) { … }
Enumerated types: Enumerated type is introduced as an alternative to static final constants.
Code:
public enum StopLight { red, amber, green };
Static import: The static import feature enables to refer to static constants from a class without needing to inherit it.
Code:
import static java.awt.BorderLayout.*;
getContentPane().add(new JPanel(), CENTER);
Formatted Output: The traditional C specific ‘printf’ functionality can be used for formatted output.
Code:
System.out.printf(”name count%n”);
System.out.printf(”%s %5d%n”, user,total);
Formatted Input: In contrast to the heavy code used to get input from standard input in earlier versions, the scanner API provides basic input functionality for reading data from standard input or other data stream.
Code:
Scanner s= new Scanner(System.in);
String param= s.next();
int value=s.nextInt();
s.close();
Varargs: It allows to pass flexible number of arguments to a method.
Code:
void argtest(Object … args){}
Concurrency utilities: The new version comes with more powerful concurrency control techniques like semaphores. It can be used to restrict access to a block of code, allows a defined number of concurrent thread accesses, and allows testing a lock before acquiring it.
Code:
final  private Semaphore s= new Semaphore(1, true);
s.acquireUninterruptibly(); //for non-blocking version use s.acquire()
try {     
      balance=balance+10; //protected value
} finally {
     s.release(); //return semaphore token
}
RMI compiler-rmic: There is no need to pre-generate stubs using rmic tool as the new version comes with the support of dynamic generation of stubs at runtime.

Class-data sharing: This feature of class-data sharing enables the sharing of read-only data between multiple running JVMs and also improves startup time as core JVM classes are pre-packed.
Monitoring: The JVM Monitoring and Management API enables monitoring and managing the Java virtual machine and the underlying operating system. The API enables applications to monitor themselves and enables JMX-compliant tools to monitor and manage a virtual machine locally and remotely including low memory detector.
JVM Profiling API (JVMTI): It includes byte code instrumentation. The advantage of this technique is that it allows more focused analysis and limits the interference of the profiling tools on the running JVM. The instrumentation can even be dynamically generated at runtime, as well as at class loading time, and pre-processed as class files.
Improved diagnostic capability: New APIs are introduced to provide complete stack trace in case of any failure. The HotSpot JVM includes a fatal error handler that can run a user-supplied script or program if the JVM aborts.
Desktop Client: New look and feel like introduction of a new theme for swing toolkit called ‘Ocean’.
Core XML support: Several revisions to core XML support including XML 1.1, SAX 2.02, DOM level 3 support and XSLT with a fast XLSTC compiler.
Supplementary character support: 32-bit supplementary character support has been added. Supplementary characters are encoded as a special pair of UTF16 values to generate a different character A surrogate pair is a combination of a high UTF16 value and a following low UTF16 value. In general, when using a String or sequence of characters, the core API libraries will transparently handle the new supplementary characters for you.
Code:
String u=”\uD840\uDC08″;
JDBC rowsets: There are five new rowset objects added in the new version.
Two of the most valuable are:
Cached rowset: It contains an in-memory collection of rows retrieved from the database that can, if needed, be synchronized at a later point in time.
Web rowset: It can write and read the RowSet in XML format.
Reply With Quote
  #2 (permalink)  
Old 08-27-2006, 03:54 PM
}|Serial_Killer|{'s Avatar
}|Serial_Killer|{ is the eye in the sky
Packet Monster
Gender: Male
My System
 
Posts: 4,306
Threads: 171
Reputation: 4
Last Online: 12-02-2008 04:31 PM
Join Date: Dec 2005
Location: 127.0.0.1
Blog Entries: 3
}|Serial_Killer|{ is an unknown quantity at this point
Send a message via MSN to }|Serial_Killer|{ Send a message via Yahoo to }|Serial_Killer|{
Default


Sun Microsystems is going to make Java Standard Edition open source, kind of.

The limitation is that not all of J2SE was developed by Sun Microsystems, so Sun an only make the portions which it developed internally open source.

It should be very interesting to see how Sun manages this with all of it's development partners.

amazingg ..huh ??
Reply With Quote
Reply

Sponsored Links

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
BAN Vs India (Toss + Highlights + Cricket thoughts + DL) amar pritibi Indoor & Outdoor Sports 2 03-18-2007 11:44 AM



All times are GMT +7. The time now is 04:10 PM.

Copyright ©2003 - 2008, Golpo Community. All Rights Reserved.
Powered by vBulletin® Version 3.8.0 Beta 4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
Islamicvdos.com | Your Ads Here
Per Insurance | Buy Anything On eBay | Free Ringtones | 2008 NFL Draft Position | Crude Oil