Friday 23 September 2011

Java 7-JDK1.7

Use the latest JDK, Java7 or JDK1.7

Java SE 7 (July 28, 2011)

Java 7 (codename Dolphin) is a major update to Java which was launched on July 7 of 2011 and was made available on July 28, 2011. The development period was organized into thirteen milestones; on February 18, 2011, milestone 13, the last milestone was reached. On average, 8 builds (which generally included enhancements and bug fixes) were released per milestone. The Feature list at the Open JDK 7 project lists many of the feature changes.
The feature additions for Java 7
  • Strings in switch
  • Automatic resource management in try-statement
  • Improved type inference for generic instance creation
  • Simplified varargs method invocation
  • Binary integer literals
  • Allowing underscores in numeric literals
  • Catching multiple exception types and rethrowing exceptions with improved type checking
  • Concurrency utilities under JSR 166
  • New file I/O library to enhance platform independence and add support for metadata and symbolic links. The new packages are java.nio.file and java.nio.file.attribute
  • Library-level support for Elliptic curve cryptography algorithms
  • An XRender pipeline for Java 2D, which improves handling of features specific to modern GPUs
  • New platform APIs for the graphics features originally planned for release in Java version 6u10
  • Enhanced library-level support for new network protocols, including SCTP and Sockets Direct Protocol
  • Upstream updates to XML and Unicode
Lambda (Java upcoming implementation of Lambda programming), Jigsaw (Java upcoming implementation of modules), and part of Coin were dropped from Java 7. Java 8 will be implemented with the remaining features in late 2012.

Tuesday 20 September 2011

Encoding & Decoding using Java

import java.io.*;
public class EncodingDecoding
{
  public static void main(Strng args[])throws IOException
  {
   BufferedReader b = new BufferedReader(new InputStreamReader(System.in));
   System.out.print("Enter a word: ");
   String s= b.readLine();
   System.out.print("Enter the number of moves: ");
   int i, m= Integer.paresInt(b.readLine());
  for(i=0;i<s.length;i++)
  {
     int ch;
     ch=s.charAt(i)+m;
     while(ch>90)
         ch=ch-26;
     while(ch<65)
         ch=ch+26;
   System.out.println((char)ch+" ");
  }
}
}