SlideShare a Scribd company logo
1 of 2
Java 2 Platform Standard Edition (J2SE) 5.0 ("Tiger") is the next major revision to the Java platform and language; it is
currently slated to contain 15 component JSRs with nearly 100 other significant updates developed through the Java
Community Process (JCP).
NOTE: The external version number of this release is 5.0 and its internal version number is 1.5.0, as described at J2SE
Naming and Versioning.
    • Generics - This long-awaited enhancement to the type system allows a type or method to operate on objects of
        various types while providing compile-time type safety. It adds compile-time type safety to the Collections
        Framework and eliminates the drudgery of casting. See the Generics Tutorial. (JSR 14)
    • Enhanced for Loop - This new language construct eliminates the drudgery and error-proneness of iterators and
        index variables when iterating over collections and arrays. (JSR 201)
    • Autoboxing/Unboxing - This facility eliminates the drudgery of manual conversion between primitive types (such
        as int) and wrapper types (such as Integer). (JSR 201)
    • Typesafe Enums - This flexible object-oriented enumerated type facility allows you to create enumerated types
        with arbitrary methods and fields. It provides all the benefits of the Typesafe Enum pattern ("Effective Java,"
        Item 21) without the verbosity and the error-proneness. (JSR 201)
    • Varargs - This facility eliminates the need for manually boxing up argument lists into an array when invoking
        methods that accept variable-length argument lists.
    • Static Import - This facility lets you avoid qualifying static members with class names without the shortcomings of
        the "Constant Interface antipattern." (JSR 201)
    • Annotations (Metadata) - This language feature lets you avoid writing boilerplate code under many
        circumstances by enabling tools to generate it from annotations in the source code. This leads to a "declarative"
        programming style where the programmer says what should be done and tools emit the code to do it. Also it
        eliminates the need for maintaining "side files" that must be kept up to date with changes in source files. Instead
        the information can be maintained in the source file. (JSR 175)
        NOTE: The @Deprecated annotation provides a way to deprecate program elements. See How and When To
        Deprecate APIs.
Metadata
The metadata feature in J2SE 5.0 provides the ability to associate additional data alongside Java classes, interfaces,
methods, and fields. This additional data, or annotation, can be read by the javac compiler or other tools, and depending
on configuration can also be stored in the class file and can be discovered at runtime using the Java reflection API.
One of the primary reasons for adding metadata to the Java platform is to enable development and runtime tools to have
a common infrastructure and so reduce the effort required for programming and deployment. A tool could use the
metadata information to generate additional source code, or to provide additional information when debugging.
In beta2 we are pleased to announce the availability of an annotation processing tool called apt. Apt includes a set of
new reflective APIs and supporting infrastructure to process program annotations. The apt reflective APIs provide a build-
time, source-based, read-only view of program structure which cleanly models the Java programming language's type
system. First, apt runs annotation processors that can produce new source code and other files. Next, apt can cause
compilation of both original and generated source files, easing development. For more information on apt refer to
the apt guide.
In the following example code you can additionally create an AnnotationFactory processor for apt to generate code or
documentation when finding the debug annotation tag.
 import java.lang.annotation.*;
 import java.lang.reflect.*;

 @Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @interface debug {
   boolean devbuild() default false;
   int counter();
 }

 public class MetaTest {
   final boolean production=true;

   @debug(devbuild=production,counter=1) public void testMethod() {
   }
  public static void main(String[] args) {
Java 5

More Related Content

What's hot

What's hot (19)

Chapter 1.3
Chapter 1.3Chapter 1.3
Chapter 1.3
 
What is-java
What is-javaWhat is-java
What is-java
 
Rational Robot (http://www.geektester.blogspot.com)
Rational Robot (http://www.geektester.blogspot.com)Rational Robot (http://www.geektester.blogspot.com)
Rational Robot (http://www.geektester.blogspot.com)
 
Oracle sun studio
Oracle sun studioOracle sun studio
Oracle sun studio
 
Java
JavaJava
Java
 
Java swing 1
Java swing 1Java swing 1
Java swing 1
 
Core java kvr - satya
Core  java kvr - satyaCore  java kvr - satya
Core java kvr - satya
 
Understanding and extending p2 for fun and profit
Understanding and extending p2 for fun and profitUnderstanding and extending p2 for fun and profit
Understanding and extending p2 for fun and profit
 
Automating API Documentation
Automating API DocumentationAutomating API Documentation
Automating API Documentation
 
Java architecture
Java architectureJava architecture
Java architecture
 
Assemblies
AssembliesAssemblies
Assemblies
 
.Net Overview -- Training (Lesson 1)
.Net Overview -- Training (Lesson 1).Net Overview -- Training (Lesson 1)
.Net Overview -- Training (Lesson 1)
 
THE CLR AND THE .NET FRAMEWORK, C#
THE CLR AND THE .NET FRAMEWORK, C#THE CLR AND THE .NET FRAMEWORK, C#
THE CLR AND THE .NET FRAMEWORK, C#
 
Java basics training 1
Java basics training 1Java basics training 1
Java basics training 1
 
Corejava ratan
Corejava ratanCorejava ratan
Corejava ratan
 
BCA IPU VB.NET UNIT-I
BCA IPU VB.NET UNIT-IBCA IPU VB.NET UNIT-I
BCA IPU VB.NET UNIT-I
 
Java vs .net
Java vs .netJava vs .net
Java vs .net
 
Verilog Pli
Verilog PliVerilog Pli
Verilog Pli
 
Dotnet framework
Dotnet frameworkDotnet framework
Dotnet framework
 

Viewers also liked (18)

I_GANAPATHY
I_GANAPATHYI_GANAPATHY
I_GANAPATHY
 
OdellResume
OdellResumeOdellResume
OdellResume
 
Thanks satis 2
Thanks   satis 2 Thanks   satis 2
Thanks satis 2
 
ANNIE Resume s
ANNIE Resume sANNIE Resume s
ANNIE Resume s
 
CaseStudySussexPolice
CaseStudySussexPoliceCaseStudySussexPolice
CaseStudySussexPolice
 
Relato historia universal
Relato historia universalRelato historia universal
Relato historia universal
 
CT Doc -Reference Daniel Vera
CT Doc -Reference Daniel VeraCT Doc -Reference Daniel Vera
CT Doc -Reference Daniel Vera
 
425BestAd
425BestAd425BestAd
425BestAd
 
MAPA CONSERTUAL
MAPA  CONSERTUALMAPA  CONSERTUAL
MAPA CONSERTUAL
 
Ley organica municipal
Ley organica municipalLey organica municipal
Ley organica municipal
 
Komponen komputer
Komponen komputerKomponen komputer
Komponen komputer
 
Luthfa CV 2016
Luthfa CV 2016Luthfa CV 2016
Luthfa CV 2016
 
ACS Calendar - March 2014
ACS Calendar - March 2014ACS Calendar - March 2014
ACS Calendar - March 2014
 
This is a really nice paper
This is a really nice paper This is a really nice paper
This is a really nice paper
 
Test2
Test2Test2
Test2
 
Pesquisa 3 -
Pesquisa  3 -Pesquisa  3 -
Pesquisa 3 -
 
TAREA
TAREATAREA
TAREA
 
Cl600 youngtimer 2
Cl600 youngtimer 2Cl600 youngtimer 2
Cl600 youngtimer 2
 

Similar to Java 5

Java dev mar_2021_keynote
Java dev mar_2021_keynoteJava dev mar_2021_keynote
Java dev mar_2021_keynoteSuyash Joshi
 
Java New Evolution
Java New EvolutionJava New Evolution
Java New EvolutionAllan Huang
 
Introduction Java Web Framework and Web Server.
Introduction Java Web Framework and Web Server.Introduction Java Web Framework and Web Server.
Introduction Java Web Framework and Web Server.suranisaunak
 
What is Java Technology (An introduction with comparision of .net coding)
What is Java Technology (An introduction with comparision of .net coding)What is Java Technology (An introduction with comparision of .net coding)
What is Java Technology (An introduction with comparision of .net coding)Shaharyar khan
 
Gwt and JSR 269's Pluggable Annotation Processing API
Gwt and JSR 269's Pluggable Annotation Processing APIGwt and JSR 269's Pluggable Annotation Processing API
Gwt and JSR 269's Pluggable Annotation Processing APIArnaud Tournier
 
Spring MVC framework
Spring MVC frameworkSpring MVC framework
Spring MVC frameworkMohit Gupta
 
J2EE PPT --CINTHIYA.M Krishnammal college for women
J2EE PPT --CINTHIYA.M Krishnammal college for womenJ2EE PPT --CINTHIYA.M Krishnammal college for women
J2EE PPT --CINTHIYA.M Krishnammal college for womenlissa cidhi
 
Java se 5 language enhancements & features
Java se 5   language enhancements & featuresJava se 5   language enhancements & features
Java se 5 language enhancements & featuresJuarez Junior
 
Java 8 in Anger (QCon London)
Java 8 in Anger (QCon London)Java 8 in Anger (QCon London)
Java 8 in Anger (QCon London)Trisha Gee
 
Java 8 in Anger, Devoxx France
Java 8 in Anger, Devoxx FranceJava 8 in Anger, Devoxx France
Java 8 in Anger, Devoxx FranceTrisha Gee
 
Reversing and Patching Java Bytecode
Reversing and Patching Java BytecodeReversing and Patching Java Bytecode
Reversing and Patching Java BytecodeTeodoro Cipresso
 
imperative programming language, java, android
imperative programming language, java, androidimperative programming language, java, android
imperative programming language, java, androidi i
 
Net Fundamentals
Net FundamentalsNet Fundamentals
Net FundamentalsAli Taki
 

Similar to Java 5 (20)

Java dev mar_2021_keynote
Java dev mar_2021_keynoteJava dev mar_2021_keynote
Java dev mar_2021_keynote
 
Java se7 features
Java se7 featuresJava se7 features
Java se7 features
 
Java New Evolution
Java New EvolutionJava New Evolution
Java New Evolution
 
Java basic
Java basicJava basic
Java basic
 
Introduction Java Web Framework and Web Server.
Introduction Java Web Framework and Web Server.Introduction Java Web Framework and Web Server.
Introduction Java Web Framework and Web Server.
 
What is Java Technology (An introduction with comparision of .net coding)
What is Java Technology (An introduction with comparision of .net coding)What is Java Technology (An introduction with comparision of .net coding)
What is Java Technology (An introduction with comparision of .net coding)
 
Gwt and JSR 269's Pluggable Annotation Processing API
Gwt and JSR 269's Pluggable Annotation Processing APIGwt and JSR 269's Pluggable Annotation Processing API
Gwt and JSR 269's Pluggable Annotation Processing API
 
Java 8 Overview
Java 8 OverviewJava 8 Overview
Java 8 Overview
 
Spring MVC framework
Spring MVC frameworkSpring MVC framework
Spring MVC framework
 
AtoZ about TYPO3 v8 CMS
AtoZ about TYPO3 v8 CMSAtoZ about TYPO3 v8 CMS
AtoZ about TYPO3 v8 CMS
 
J2EE PPT --CINTHIYA.M Krishnammal college for women
J2EE PPT --CINTHIYA.M Krishnammal college for womenJ2EE PPT --CINTHIYA.M Krishnammal college for women
J2EE PPT --CINTHIYA.M Krishnammal college for women
 
11i Logs
11i Logs11i Logs
11i Logs
 
Java se 5 language enhancements & features
Java se 5   language enhancements & featuresJava se 5   language enhancements & features
Java se 5 language enhancements & features
 
Java 8 in Anger (QCon London)
Java 8 in Anger (QCon London)Java 8 in Anger (QCon London)
Java 8 in Anger (QCon London)
 
Java 8 in Anger, Devoxx France
Java 8 in Anger, Devoxx FranceJava 8 in Anger, Devoxx France
Java 8 in Anger, Devoxx France
 
Reversing and Patching Java Bytecode
Reversing and Patching Java BytecodeReversing and Patching Java Bytecode
Reversing and Patching Java Bytecode
 
Java chapter 1
Java   chapter 1Java   chapter 1
Java chapter 1
 
JDK 10 Java Module System
JDK 10 Java Module SystemJDK 10 Java Module System
JDK 10 Java Module System
 
imperative programming language, java, android
imperative programming language, java, androidimperative programming language, java, android
imperative programming language, java, android
 
Net Fundamentals
Net FundamentalsNet Fundamentals
Net Fundamentals
 

Java 5

  • 1. Java 2 Platform Standard Edition (J2SE) 5.0 ("Tiger") is the next major revision to the Java platform and language; it is currently slated to contain 15 component JSRs with nearly 100 other significant updates developed through the Java Community Process (JCP). NOTE: The external version number of this release is 5.0 and its internal version number is 1.5.0, as described at J2SE Naming and Versioning. • Generics - This long-awaited enhancement to the type system allows a type or method to operate on objects of various types while providing compile-time type safety. It adds compile-time type safety to the Collections Framework and eliminates the drudgery of casting. See the Generics Tutorial. (JSR 14) • Enhanced for Loop - This new language construct eliminates the drudgery and error-proneness of iterators and index variables when iterating over collections and arrays. (JSR 201) • Autoboxing/Unboxing - This facility eliminates the drudgery of manual conversion between primitive types (such as int) and wrapper types (such as Integer). (JSR 201) • Typesafe Enums - This flexible object-oriented enumerated type facility allows you to create enumerated types with arbitrary methods and fields. It provides all the benefits of the Typesafe Enum pattern ("Effective Java," Item 21) without the verbosity and the error-proneness. (JSR 201) • Varargs - This facility eliminates the need for manually boxing up argument lists into an array when invoking methods that accept variable-length argument lists. • Static Import - This facility lets you avoid qualifying static members with class names without the shortcomings of the "Constant Interface antipattern." (JSR 201) • Annotations (Metadata) - This language feature lets you avoid writing boilerplate code under many circumstances by enabling tools to generate it from annotations in the source code. This leads to a "declarative" programming style where the programmer says what should be done and tools emit the code to do it. Also it eliminates the need for maintaining "side files" that must be kept up to date with changes in source files. Instead the information can be maintained in the source file. (JSR 175) NOTE: The @Deprecated annotation provides a way to deprecate program elements. See How and When To Deprecate APIs. Metadata The metadata feature in J2SE 5.0 provides the ability to associate additional data alongside Java classes, interfaces, methods, and fields. This additional data, or annotation, can be read by the javac compiler or other tools, and depending on configuration can also be stored in the class file and can be discovered at runtime using the Java reflection API. One of the primary reasons for adding metadata to the Java platform is to enable development and runtime tools to have a common infrastructure and so reduce the effort required for programming and deployment. A tool could use the metadata information to generate additional source code, or to provide additional information when debugging. In beta2 we are pleased to announce the availability of an annotation processing tool called apt. Apt includes a set of new reflective APIs and supporting infrastructure to process program annotations. The apt reflective APIs provide a build- time, source-based, read-only view of program structure which cleanly models the Java programming language's type system. First, apt runs annotation processors that can produce new source code and other files. Next, apt can cause compilation of both original and generated source files, easing development. For more information on apt refer to the apt guide. In the following example code you can additionally create an AnnotationFactory processor for apt to generate code or documentation when finding the debug annotation tag. import java.lang.annotation.*; import java.lang.reflect.*; @Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @interface debug { boolean devbuild() default false; int counter(); } public class MetaTest { final boolean production=true; @debug(devbuild=production,counter=1) public void testMethod() { } public static void main(String[] args) {