SlideShare a Scribd company logo
1 of 20
  Tossing the Project Coin!   Marimuthu Rajagopal
Java Version History Language Enhancement Version Release Date Language Enhancement JDK 1.0 Jan 23, 1996 (Initial Release)Oak JDK 1.1 Feb 19,1997 Inner Class ,Reflection,JavaBeans,JDBC,RMI J2SE 1.2 Dec 8, 1998 Strictfp, Collection frame work J2SE 1.3 May 8,2000 Hotspot JVM,JNDI,JPDA J2SE 1.4 Feb 6,2002 Assert, Regular expression,exception chaining. J2SE 1.5 Sep 30,2004 Generics,annotation,auto  boxing,Enumeration,Var  args,for each,staticimport Java SE 6 Dec 11,2006 Scripting  Language Support,Performance Improvement Java SE 7 July 07,2011 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Java SE 8 ,[object Object]
Java 7 Language Enhancement(Project Coin) JSR 334 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
String in Switch ,[object Object],[object Object],[object Object],[object Object],http://download.java.net/jdk7/docs/technotes/guides/language/strings-switch.html   http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#15.28  http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#5313
String in Switch Java 6 and Prior public static String getTypeOfDayWithSwitchStatement(String dayOfWeekArg) { String typeOfDay="";  if(dayOfWeekArg.equals("Monday")) typeOfDay="Start of Work week"; else if(dayOfWeekArg.equals("Tuesday")|| dayOfWeekArg.equals("Wednesday")|| dayOfWeekArg.equals("Thursday")) typeOfDay="Midweek"; else if(dayOfWeekArg.equals("Friday")) typeOfDay="End of work week"; else if(dayOfWeekArg.equals("Saturday")|| dayOfWeekArg.equals("Sunday")) typeOfDay="Week off"; else typeOfDay="Invalid day"; return typeOfDay; } http://download.java.net/jdk7/docs/technotes/guides/language/strings-switch.html
String in Switch Java 7 public static String getTypeOfDayWithSwitchStatement(String dayOfWeekArg) { String typeOfDay="";  switch (dayOfWeekArg) { case "Monday": typeOfDay="Start of Work week"; break; case "Tuesday": case "Wednesday": case "Thursday": typeOfDay="Midweek"; break; case "Friday": typeOfDay="End of work week"; break; case "Saturday": case "Sunday": typeOfDay="Week off"; break; default: typeOfDay="Invalid day"; break; } return typeOfDay;  } http://download.java.net/jdk7/docs/technotes/guides/language/strings-switch.html
Binary literal & Underscore in literal ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],http://download.java.net/jdk7/docs/technotes/guides/language/binary-literals.html http://download.java.net/jdk7/docs/technotes/guides/language/underscores-literals.html
Binary literal & Underscore in literal ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Multi-Catch and More precise rethrow. ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],http://download.java.net/jdk7/docs/technotes/guides/language/catch-multiple.html
Multi-Catch. Java 6 and Prior   try{ // Method method=Object.class.getMethod("toString"); final Class[] ARG_TYPE=new Class[]{String.class}; Method method=Integer.class.getMethod("parseInt",ARG_TYPE); Object result=method.invoke(null,new Object[]{new String("44")}); System.out.println("result:"+result.toString()); } catch(NoSuchMethodException e) { e.printStackTrace(); }catch(IllegalAccessException e) { e.printStackTrace(); } catch(InvocationTargetException e) { e.printStackTrace(); }
Multi-Catch. Java 7 try{ // Method method=Object.class.getMethod("toString"); final Class[] ARG_TYPE=new Class[]{String.class}; Method method=Integer.class.getMethod("parseInt",ARG_TYPE); Object result=method.invoke(null,new Object[]{new String("44")}); System.out.println("result:"+result.toString()); } catch( NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { e.printStackTrace(); }
More precise rethrow. Java 6 and Prior public static void precise() throws NoSuchMethodException, IllegalAccessException { try{ // Method method=Object.class.getMethod("toString"); final Class[] ARG_TYPE=new Class[]{String.class}; Method method=Integer.class.getMethod("parseInt",ARG_TYPE); Object result=method.invoke(null,new Object[]{new String("44")}); System.out.println("result:"+result.toString()); } catch(Exception e) { throw  new NoSuchMethodException(); } }
More precise rethrow. Java 7 public static void precise() throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { try{ // Method method=Object.class.getMethod("toString"); final Class[] ARG_TYPE=new Class[]{String.class}; Method method=Integer.class.getMethod("parseInt",ARG_TYPE); Object result=method.invoke(null,new Object[]{new String("44")}); System.out.println("result:"+result.toString()); } catch(ReflectiveOperationException e) { throw e; } }
Try-with-Resources statement. ,[object Object],[object Object],[object Object],[object Object],[object Object],http://download.java.net/jdk7/docs/technotes/guides/language/catch-multiple.html
Try-with-Resources statement. Java 6 and Prior static void jdk16writeFile(String path)  { BufferedWriter bw = null; try  { bw=new BufferedWriter(new FileWriter(path)); bw.write("JDK1.6 Need to close resource manualy."); }catch(IOException e) { e.printStackTrace(); } finally { try { bw.close(); } catch (IOException ex) { ex.printStackTrace(); } } }
Try-with-Resources statement. Java 7 static void jdk17writeFile(String path) { try (BufferedWriter bw = new BufferedWriter(new FileWriter(path))) { bw.write("Welcome to JDK1.7 Try with resource concept"); } catch(IOException ex) ‏ { System.out.println("ex"+ex); } }
Diamond Operator(Type Inference for Generic Instance Creation) ‏ ,[object Object],[object Object],[object Object],[object Object],http://download.java.net/jdk7/docs/technotes/guides/language/catch-multiple.html
Diamond Operator(Type Inference for Generic Instance Creation) ‏ In Java 6 and Prior List<String> jvmLanguages=new ArrayList<String>(); In Java 7 List<String> jvmLanguages=new ArrayList<>(); jvmLanguages.add(&quot;Groovy&quot;); jvmLanguages.add(&quot;Scala&quot;); System.out.println(jvmLanguages); Type Inference List<?> typeinference=new ArrayList<> ();
Improved compiler warnings for Varargs ,[object Object],[object Object],[object Object],[object Object],[object Object]
Thank you Q&A    e-mail :muthu.svm@gmail.com  blog :http://microtechinfo.blogspot.com

More Related Content

What's hot

Inside the JVM - Follow the white rabbit!
Inside the JVM - Follow the white rabbit!Inside the JVM - Follow the white rabbit!
Inside the JVM - Follow the white rabbit!Sylvain Wallez
 
Objective-C Blocks and Grand Central Dispatch
Objective-C Blocks and Grand Central DispatchObjective-C Blocks and Grand Central Dispatch
Objective-C Blocks and Grand Central DispatchMatteo Battaglio
 
Making Java Groovy (JavaOne 2013)
Making Java Groovy (JavaOne 2013)Making Java Groovy (JavaOne 2013)
Making Java Groovy (JavaOne 2013)Ken Kousen
 
Wait for your fortune without Blocking!
Wait for your fortune without Blocking!Wait for your fortune without Blocking!
Wait for your fortune without Blocking!Roman Elizarov
 
Kotlin is charming; The reasons Java engineers should start Kotlin.
Kotlin is charming; The reasons Java engineers should start Kotlin.Kotlin is charming; The reasons Java engineers should start Kotlin.
Kotlin is charming; The reasons Java engineers should start Kotlin.JustSystems Corporation
 
Java9を迎えた今こそ!Java本格(再)入門
Java9を迎えた今こそ!Java本格(再)入門Java9を迎えた今こそ!Java本格(再)入門
Java9を迎えた今こそ!Java本格(再)入門Takuya Okada
 
Inside the JVM - Follow the white rabbit! / Breizh JUG
Inside the JVM - Follow the white rabbit! / Breizh JUGInside the JVM - Follow the white rabbit! / Breizh JUG
Inside the JVM - Follow the white rabbit! / Breizh JUGSylvain Wallez
 
JRuby @ Boulder Ruby
JRuby @ Boulder RubyJRuby @ Boulder Ruby
JRuby @ Boulder RubyNick Sieger
 
Java Performance Tuning
Java Performance TuningJava Performance Tuning
Java Performance TuningMinh Hoang
 
Jenkins 2を使った究極のpipeline ~ 明日もう一度来てください、本物のpipelineをお見せしますよ ~
Jenkins 2を使った究極のpipeline ~ 明日もう一度来てください、本物のpipelineをお見せしますよ ~Jenkins 2を使った究極のpipeline ~ 明日もう一度来てください、本物のpipelineをお見せしますよ ~
Jenkins 2を使った究極のpipeline ~ 明日もう一度来てください、本物のpipelineをお見せしますよ ~ikikko
 
JavaOne 2011 - JVM Bytecode for Dummies
JavaOne 2011 - JVM Bytecode for DummiesJavaOne 2011 - JVM Bytecode for Dummies
JavaOne 2011 - JVM Bytecode for DummiesCharles Nutter
 
スローダウン、ハングを一発解決 スレッドダンプはトラブルシューティングの味方 #wlstudy
スローダウン、ハングを一発解決 スレッドダンプはトラブルシューティングの味方 #wlstudyスローダウン、ハングを一発解決 スレッドダンプはトラブルシューティングの味方 #wlstudy
スローダウン、ハングを一発解決 スレッドダンプはトラブルシューティングの味方 #wlstudyYusuke Yamamoto
 
Metaprogramming with Groovy
Metaprogramming with GroovyMetaprogramming with Groovy
Metaprogramming with GroovyAli Tanwir
 
What I Love About Ruby
What I Love About RubyWhat I Love About Ruby
What I Love About RubyKeith Bennett
 
Fun with Functional Programming in Clojure
Fun with Functional Programming in ClojureFun with Functional Programming in Clojure
Fun with Functional Programming in ClojureCodemotion
 
2007 09 10 Fzi Training Groovy Grails V Ws
2007 09 10 Fzi Training Groovy Grails V Ws2007 09 10 Fzi Training Groovy Grails V Ws
2007 09 10 Fzi Training Groovy Grails V Wsloffenauer
 
Fast as C: How to Write Really Terrible Java
Fast as C: How to Write Really Terrible JavaFast as C: How to Write Really Terrible Java
Fast as C: How to Write Really Terrible JavaCharles Nutter
 
Connecting the Worlds of Java and Ruby with JRuby
Connecting the Worlds of Java and Ruby with JRubyConnecting the Worlds of Java and Ruby with JRuby
Connecting the Worlds of Java and Ruby with JRubyNick Sieger
 
Beyond JVM - YOW! Sydney 2013
Beyond JVM - YOW! Sydney 2013Beyond JVM - YOW! Sydney 2013
Beyond JVM - YOW! Sydney 2013Charles Nutter
 
Little Helpers for Android Development with Kotlin
Little Helpers for Android Development with KotlinLittle Helpers for Android Development with Kotlin
Little Helpers for Android Development with KotlinKai Koenig
 

What's hot (20)

Inside the JVM - Follow the white rabbit!
Inside the JVM - Follow the white rabbit!Inside the JVM - Follow the white rabbit!
Inside the JVM - Follow the white rabbit!
 
Objective-C Blocks and Grand Central Dispatch
Objective-C Blocks and Grand Central DispatchObjective-C Blocks and Grand Central Dispatch
Objective-C Blocks and Grand Central Dispatch
 
Making Java Groovy (JavaOne 2013)
Making Java Groovy (JavaOne 2013)Making Java Groovy (JavaOne 2013)
Making Java Groovy (JavaOne 2013)
 
Wait for your fortune without Blocking!
Wait for your fortune without Blocking!Wait for your fortune without Blocking!
Wait for your fortune without Blocking!
 
Kotlin is charming; The reasons Java engineers should start Kotlin.
Kotlin is charming; The reasons Java engineers should start Kotlin.Kotlin is charming; The reasons Java engineers should start Kotlin.
Kotlin is charming; The reasons Java engineers should start Kotlin.
 
Java9を迎えた今こそ!Java本格(再)入門
Java9を迎えた今こそ!Java本格(再)入門Java9を迎えた今こそ!Java本格(再)入門
Java9を迎えた今こそ!Java本格(再)入門
 
Inside the JVM - Follow the white rabbit! / Breizh JUG
Inside the JVM - Follow the white rabbit! / Breizh JUGInside the JVM - Follow the white rabbit! / Breizh JUG
Inside the JVM - Follow the white rabbit! / Breizh JUG
 
JRuby @ Boulder Ruby
JRuby @ Boulder RubyJRuby @ Boulder Ruby
JRuby @ Boulder Ruby
 
Java Performance Tuning
Java Performance TuningJava Performance Tuning
Java Performance Tuning
 
Jenkins 2を使った究極のpipeline ~ 明日もう一度来てください、本物のpipelineをお見せしますよ ~
Jenkins 2を使った究極のpipeline ~ 明日もう一度来てください、本物のpipelineをお見せしますよ ~Jenkins 2を使った究極のpipeline ~ 明日もう一度来てください、本物のpipelineをお見せしますよ ~
Jenkins 2を使った究極のpipeline ~ 明日もう一度来てください、本物のpipelineをお見せしますよ ~
 
JavaOne 2011 - JVM Bytecode for Dummies
JavaOne 2011 - JVM Bytecode for DummiesJavaOne 2011 - JVM Bytecode for Dummies
JavaOne 2011 - JVM Bytecode for Dummies
 
スローダウン、ハングを一発解決 スレッドダンプはトラブルシューティングの味方 #wlstudy
スローダウン、ハングを一発解決 スレッドダンプはトラブルシューティングの味方 #wlstudyスローダウン、ハングを一発解決 スレッドダンプはトラブルシューティングの味方 #wlstudy
スローダウン、ハングを一発解決 スレッドダンプはトラブルシューティングの味方 #wlstudy
 
Metaprogramming with Groovy
Metaprogramming with GroovyMetaprogramming with Groovy
Metaprogramming with Groovy
 
What I Love About Ruby
What I Love About RubyWhat I Love About Ruby
What I Love About Ruby
 
Fun with Functional Programming in Clojure
Fun with Functional Programming in ClojureFun with Functional Programming in Clojure
Fun with Functional Programming in Clojure
 
2007 09 10 Fzi Training Groovy Grails V Ws
2007 09 10 Fzi Training Groovy Grails V Ws2007 09 10 Fzi Training Groovy Grails V Ws
2007 09 10 Fzi Training Groovy Grails V Ws
 
Fast as C: How to Write Really Terrible Java
Fast as C: How to Write Really Terrible JavaFast as C: How to Write Really Terrible Java
Fast as C: How to Write Really Terrible Java
 
Connecting the Worlds of Java and Ruby with JRuby
Connecting the Worlds of Java and Ruby with JRubyConnecting the Worlds of Java and Ruby with JRuby
Connecting the Worlds of Java and Ruby with JRuby
 
Beyond JVM - YOW! Sydney 2013
Beyond JVM - YOW! Sydney 2013Beyond JVM - YOW! Sydney 2013
Beyond JVM - YOW! Sydney 2013
 
Little Helpers for Android Development with Kotlin
Little Helpers for Android Development with KotlinLittle Helpers for Android Development with Kotlin
Little Helpers for Android Development with Kotlin
 

Viewers also liked

Mobile Game and Application with J2ME - Collision Detection
Mobile Gameand Application withJ2ME  - Collision DetectionMobile Gameand Application withJ2ME  - Collision Detection
Mobile Game and Application with J2ME - Collision DetectionJenchoke Tachagomain
 
J2 Me Mobile Application
J2 Me Mobile ApplicationJ2 Me Mobile Application
J2 Me Mobile ApplicationImranahmed_19
 
Session2-J2ME development-environment
Session2-J2ME development-environmentSession2-J2ME development-environment
Session2-J2ME development-environmentmuthusvm
 
Recordmanagment
RecordmanagmentRecordmanagment
Recordmanagmentmyrajendra
 
Record listener interface
Record listener interfaceRecord listener interface
Record listener interfacemyrajendra
 
Interface record comparator
Interface record comparatorInterface record comparator
Interface record comparatormyrajendra
 
Interface record enumeration
Interface record enumerationInterface record enumeration
Interface record enumerationmyrajendra
 
Session 3 J2ME Mobile Information Device Profile(MIDP) API
Session 3 J2ME Mobile Information Device Profile(MIDP)  APISession 3 J2ME Mobile Information Device Profile(MIDP)  API
Session 3 J2ME Mobile Information Device Profile(MIDP) APImuthusvm
 
Recordmanagment2
Recordmanagment2Recordmanagment2
Recordmanagment2myrajendra
 
Session1 j2me introduction
Session1  j2me introductionSession1  j2me introduction
Session1 j2me introductionmuthusvm
 
Interface connection
Interface connectionInterface connection
Interface connectionmyrajendra
 
High-Level Display: Screen J2ME User Interface
High-Level Display: Screen J2ME User InterfaceHigh-Level Display: Screen J2ME User Interface
High-Level Display: Screen J2ME User Interfacesuman sinkhwal
 
Session4 J2ME Mobile Information Device Profile(MIDP) Events
Session4 J2ME Mobile Information Device Profile(MIDP) EventsSession4 J2ME Mobile Information Device Profile(MIDP) Events
Session4 J2ME Mobile Information Device Profile(MIDP) Eventsmuthusvm
 
Interface Record filter
Interface Record filterInterface Record filter
Interface Record filtermyrajendra
 

Viewers also liked (20)

Mobile Game and Application with J2ME - Collision Detection
Mobile Gameand Application withJ2ME  - Collision DetectionMobile Gameand Application withJ2ME  - Collision Detection
Mobile Game and Application with J2ME - Collision Detection
 
Android architecture
Android architectureAndroid architecture
Android architecture
 
J2 Me Mobile Application
J2 Me Mobile ApplicationJ2 Me Mobile Application
J2 Me Mobile Application
 
Session2-J2ME development-environment
Session2-J2ME development-environmentSession2-J2ME development-environment
Session2-J2ME development-environment
 
Recordmanagment
RecordmanagmentRecordmanagment
Recordmanagment
 
Record listener interface
Record listener interfaceRecord listener interface
Record listener interface
 
Interface record comparator
Interface record comparatorInterface record comparator
Interface record comparator
 
Interface record enumeration
Interface record enumerationInterface record enumeration
Interface record enumeration
 
M rec enum
M rec enumM rec enum
M rec enum
 
Session 3 J2ME Mobile Information Device Profile(MIDP) API
Session 3 J2ME Mobile Information Device Profile(MIDP)  APISession 3 J2ME Mobile Information Device Profile(MIDP)  API
Session 3 J2ME Mobile Information Device Profile(MIDP) API
 
J2ME
J2MEJ2ME
J2ME
 
Recordmanagment2
Recordmanagment2Recordmanagment2
Recordmanagment2
 
Session1 j2me introduction
Session1  j2me introductionSession1  j2me introduction
Session1 j2me introduction
 
Wr ex2
Wr ex2Wr ex2
Wr ex2
 
Exceptions
ExceptionsExceptions
Exceptions
 
Interface connection
Interface connectionInterface connection
Interface connection
 
High-Level Display: Screen J2ME User Interface
High-Level Display: Screen J2ME User InterfaceHigh-Level Display: Screen J2ME User Interface
High-Level Display: Screen J2ME User Interface
 
Session4 J2ME Mobile Information Device Profile(MIDP) Events
Session4 J2ME Mobile Information Device Profile(MIDP) EventsSession4 J2ME Mobile Information Device Profile(MIDP) Events
Session4 J2ME Mobile Information Device Profile(MIDP) Events
 
Interface Record filter
Interface Record filterInterface Record filter
Interface Record filter
 
Record store
Record storeRecord store
Record store
 

Similar to Java 7 Language Enhancement

Java 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from OredevJava 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from OredevMattias Karlsson
 
Java Intro
Java IntroJava Intro
Java Introbackdoor
 
New Features Of JDK 7
New Features Of JDK 7New Features Of JDK 7
New Features Of JDK 7Deniz Oguz
 
Boosting Your Testing Productivity with Groovy
Boosting Your Testing Productivity with GroovyBoosting Your Testing Productivity with Groovy
Boosting Your Testing Productivity with GroovyJames Williams
 
Javaone2008 Bof 5101 Groovytesting
Javaone2008 Bof 5101 GroovytestingJavaone2008 Bof 5101 Groovytesting
Javaone2008 Bof 5101 GroovytestingAndres Almiray
 
Java 7 new features
Java 7 new featuresJava 7 new features
Java 7 new featuresShivam Goel
 
Introduction to Javascript
Introduction to JavascriptIntroduction to Javascript
Introduction to JavascriptAmit Tyagi
 
JavaScript Growing Up
JavaScript Growing UpJavaScript Growing Up
JavaScript Growing UpDavid Padbury
 
Java 14 features
Java 14 featuresJava 14 features
Java 14 featuresAditi Anand
 
Sqladria 2009 SRC
Sqladria 2009 SRCSqladria 2009 SRC
Sqladria 2009 SRCtepsum
 
Persisting Your Objects In The Database World @ AlphaCSP Professional OSS Con...
Persisting Your Objects In The Database World @ AlphaCSP Professional OSS Con...Persisting Your Objects In The Database World @ AlphaCSP Professional OSS Con...
Persisting Your Objects In The Database World @ AlphaCSP Professional OSS Con...Baruch Sadogursky
 
GTAC Boosting your Testing Productivity with Groovy
GTAC Boosting your Testing Productivity with GroovyGTAC Boosting your Testing Productivity with Groovy
GTAC Boosting your Testing Productivity with GroovyAndres Almiray
 
jrubykaigi2010-lt-rubeus
jrubykaigi2010-lt-rubeusjrubykaigi2010-lt-rubeus
jrubykaigi2010-lt-rubeusTakeshi AKIMA
 
Introduction To Groovy 2005
Introduction To Groovy 2005Introduction To Groovy 2005
Introduction To Groovy 2005Tugdual Grall
 
모던자바의 역습
모던자바의 역습모던자바의 역습
모던자바의 역습DoHyun Jung
 

Similar to Java 7 Language Enhancement (20)

Project Coin
Project CoinProject Coin
Project Coin
 
Java 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from OredevJava 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from Oredev
 
Java Intro
Java IntroJava Intro
Java Intro
 
New Features Of JDK 7
New Features Of JDK 7New Features Of JDK 7
New Features Of JDK 7
 
Mastering Java ByteCode
Mastering Java ByteCodeMastering Java ByteCode
Mastering Java ByteCode
 
Boosting Your Testing Productivity with Groovy
Boosting Your Testing Productivity with GroovyBoosting Your Testing Productivity with Groovy
Boosting Your Testing Productivity with Groovy
 
Javaone2008 Bof 5101 Groovytesting
Javaone2008 Bof 5101 GroovytestingJavaone2008 Bof 5101 Groovytesting
Javaone2008 Bof 5101 Groovytesting
 
Java 7 new features
Java 7 new featuresJava 7 new features
Java 7 new features
 
Java 7 & 8 New Features
Java 7 & 8 New FeaturesJava 7 & 8 New Features
Java 7 & 8 New Features
 
Introduction to Javascript
Introduction to JavascriptIntroduction to Javascript
Introduction to Javascript
 
JavaScript Growing Up
JavaScript Growing UpJavaScript Growing Up
JavaScript Growing Up
 
Java 14 features
Java 14 featuresJava 14 features
Java 14 features
 
Sqladria 2009 SRC
Sqladria 2009 SRCSqladria 2009 SRC
Sqladria 2009 SRC
 
Persisting Your Objects In The Database World @ AlphaCSP Professional OSS Con...
Persisting Your Objects In The Database World @ AlphaCSP Professional OSS Con...Persisting Your Objects In The Database World @ AlphaCSP Professional OSS Con...
Persisting Your Objects In The Database World @ AlphaCSP Professional OSS Con...
 
JS everywhere 2011
JS everywhere 2011JS everywhere 2011
JS everywhere 2011
 
GTAC Boosting your Testing Productivity with Groovy
GTAC Boosting your Testing Productivity with GroovyGTAC Boosting your Testing Productivity with Groovy
GTAC Boosting your Testing Productivity with Groovy
 
jrubykaigi2010-lt-rubeus
jrubykaigi2010-lt-rubeusjrubykaigi2010-lt-rubeus
jrubykaigi2010-lt-rubeus
 
Introduction To Groovy 2005
Introduction To Groovy 2005Introduction To Groovy 2005
Introduction To Groovy 2005
 
모던자바의 역습
모던자바의 역습모던자바의 역습
모던자바의 역습
 
roofimon@njug5
roofimon@njug5roofimon@njug5
roofimon@njug5
 

More from muthusvm

Session13 J2ME Timer
Session13  J2ME TimerSession13  J2ME Timer
Session13 J2ME Timermuthusvm
 
Session12 J2ME Generic Connection Framework
Session12 J2ME Generic Connection FrameworkSession12 J2ME Generic Connection Framework
Session12 J2ME Generic Connection Frameworkmuthusvm
 
Session11 J2ME Record Management System Database
Session11 J2ME Record Management System DatabaseSession11 J2ME Record Management System Database
Session11 J2ME Record Management System Databasemuthusvm
 
Session11 J2ME MID-Low Level User Interface(LLUI)-graphics
Session11 J2ME MID-Low Level User Interface(LLUI)-graphicsSession11 J2ME MID-Low Level User Interface(LLUI)-graphics
Session11 J2ME MID-Low Level User Interface(LLUI)-graphicsmuthusvm
 
Session11 J2ME Record Management System
Session11 J2ME Record Management SystemSession11 J2ME Record Management System
Session11 J2ME Record Management Systemmuthusvm
 
Session10 J2ME Record Management System
Session10 J2ME Record Management SystemSession10 J2ME Record Management System
Session10 J2ME Record Management Systemmuthusvm
 
Session9 J2ME Record Management System
Session9 J2ME Record Management SystemSession9 J2ME Record Management System
Session9 J2ME Record Management Systemmuthusvm
 
Session8 J2ME Low Level User Interface
Session8 J2ME Low Level User InterfaceSession8 J2ME Low Level User Interface
Session8 J2ME Low Level User Interfacemuthusvm
 
Session7 J2ME High Level User Interface(HLUI) part1-2
Session7 J2ME High Level User Interface(HLUI) part1-2Session7 J2ME High Level User Interface(HLUI) part1-2
Session7 J2ME High Level User Interface(HLUI) part1-2muthusvm
 
Session6 J2ME High Level User Interface(HLUI) part1
Session6 J2ME High Level User Interface(HLUI) part1Session6 J2ME High Level User Interface(HLUI) part1
Session6 J2ME High Level User Interface(HLUI) part1muthusvm
 
Session5 J2ME High Level User Interface(HLUI) part1
Session5 J2ME High Level User Interface(HLUI) part1Session5 J2ME High Level User Interface(HLUI) part1
Session5 J2ME High Level User Interface(HLUI) part1muthusvm
 

More from muthusvm (11)

Session13 J2ME Timer
Session13  J2ME TimerSession13  J2ME Timer
Session13 J2ME Timer
 
Session12 J2ME Generic Connection Framework
Session12 J2ME Generic Connection FrameworkSession12 J2ME Generic Connection Framework
Session12 J2ME Generic Connection Framework
 
Session11 J2ME Record Management System Database
Session11 J2ME Record Management System DatabaseSession11 J2ME Record Management System Database
Session11 J2ME Record Management System Database
 
Session11 J2ME MID-Low Level User Interface(LLUI)-graphics
Session11 J2ME MID-Low Level User Interface(LLUI)-graphicsSession11 J2ME MID-Low Level User Interface(LLUI)-graphics
Session11 J2ME MID-Low Level User Interface(LLUI)-graphics
 
Session11 J2ME Record Management System
Session11 J2ME Record Management SystemSession11 J2ME Record Management System
Session11 J2ME Record Management System
 
Session10 J2ME Record Management System
Session10 J2ME Record Management SystemSession10 J2ME Record Management System
Session10 J2ME Record Management System
 
Session9 J2ME Record Management System
Session9 J2ME Record Management SystemSession9 J2ME Record Management System
Session9 J2ME Record Management System
 
Session8 J2ME Low Level User Interface
Session8 J2ME Low Level User InterfaceSession8 J2ME Low Level User Interface
Session8 J2ME Low Level User Interface
 
Session7 J2ME High Level User Interface(HLUI) part1-2
Session7 J2ME High Level User Interface(HLUI) part1-2Session7 J2ME High Level User Interface(HLUI) part1-2
Session7 J2ME High Level User Interface(HLUI) part1-2
 
Session6 J2ME High Level User Interface(HLUI) part1
Session6 J2ME High Level User Interface(HLUI) part1Session6 J2ME High Level User Interface(HLUI) part1
Session6 J2ME High Level User Interface(HLUI) part1
 
Session5 J2ME High Level User Interface(HLUI) part1
Session5 J2ME High Level User Interface(HLUI) part1Session5 J2ME High Level User Interface(HLUI) part1
Session5 J2ME High Level User Interface(HLUI) part1
 

Recently uploaded

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 

Recently uploaded (20)

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 

Java 7 Language Enhancement

  • 1.   Tossing the Project Coin!   Marimuthu Rajagopal
  • 2.
  • 3.
  • 4.
  • 5. String in Switch Java 6 and Prior public static String getTypeOfDayWithSwitchStatement(String dayOfWeekArg) { String typeOfDay=&quot;&quot;; if(dayOfWeekArg.equals(&quot;Monday&quot;)) typeOfDay=&quot;Start of Work week&quot;; else if(dayOfWeekArg.equals(&quot;Tuesday&quot;)|| dayOfWeekArg.equals(&quot;Wednesday&quot;)|| dayOfWeekArg.equals(&quot;Thursday&quot;)) typeOfDay=&quot;Midweek&quot;; else if(dayOfWeekArg.equals(&quot;Friday&quot;)) typeOfDay=&quot;End of work week&quot;; else if(dayOfWeekArg.equals(&quot;Saturday&quot;)|| dayOfWeekArg.equals(&quot;Sunday&quot;)) typeOfDay=&quot;Week off&quot;; else typeOfDay=&quot;Invalid day&quot;; return typeOfDay; } http://download.java.net/jdk7/docs/technotes/guides/language/strings-switch.html
  • 6. String in Switch Java 7 public static String getTypeOfDayWithSwitchStatement(String dayOfWeekArg) { String typeOfDay=&quot;&quot;; switch (dayOfWeekArg) { case &quot;Monday&quot;: typeOfDay=&quot;Start of Work week&quot;; break; case &quot;Tuesday&quot;: case &quot;Wednesday&quot;: case &quot;Thursday&quot;: typeOfDay=&quot;Midweek&quot;; break; case &quot;Friday&quot;: typeOfDay=&quot;End of work week&quot;; break; case &quot;Saturday&quot;: case &quot;Sunday&quot;: typeOfDay=&quot;Week off&quot;; break; default: typeOfDay=&quot;Invalid day&quot;; break; } return typeOfDay; } http://download.java.net/jdk7/docs/technotes/guides/language/strings-switch.html
  • 7.
  • 8.
  • 9.
  • 10. Multi-Catch. Java 6 and Prior try{ // Method method=Object.class.getMethod(&quot;toString&quot;); final Class[] ARG_TYPE=new Class[]{String.class}; Method method=Integer.class.getMethod(&quot;parseInt&quot;,ARG_TYPE); Object result=method.invoke(null,new Object[]{new String(&quot;44&quot;)}); System.out.println(&quot;result:&quot;+result.toString()); } catch(NoSuchMethodException e) { e.printStackTrace(); }catch(IllegalAccessException e) { e.printStackTrace(); } catch(InvocationTargetException e) { e.printStackTrace(); }
  • 11. Multi-Catch. Java 7 try{ // Method method=Object.class.getMethod(&quot;toString&quot;); final Class[] ARG_TYPE=new Class[]{String.class}; Method method=Integer.class.getMethod(&quot;parseInt&quot;,ARG_TYPE); Object result=method.invoke(null,new Object[]{new String(&quot;44&quot;)}); System.out.println(&quot;result:&quot;+result.toString()); } catch( NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { e.printStackTrace(); }
  • 12. More precise rethrow. Java 6 and Prior public static void precise() throws NoSuchMethodException, IllegalAccessException { try{ // Method method=Object.class.getMethod(&quot;toString&quot;); final Class[] ARG_TYPE=new Class[]{String.class}; Method method=Integer.class.getMethod(&quot;parseInt&quot;,ARG_TYPE); Object result=method.invoke(null,new Object[]{new String(&quot;44&quot;)}); System.out.println(&quot;result:&quot;+result.toString()); } catch(Exception e) { throw new NoSuchMethodException(); } }
  • 13. More precise rethrow. Java 7 public static void precise() throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { try{ // Method method=Object.class.getMethod(&quot;toString&quot;); final Class[] ARG_TYPE=new Class[]{String.class}; Method method=Integer.class.getMethod(&quot;parseInt&quot;,ARG_TYPE); Object result=method.invoke(null,new Object[]{new String(&quot;44&quot;)}); System.out.println(&quot;result:&quot;+result.toString()); } catch(ReflectiveOperationException e) { throw e; } }
  • 14.
  • 15. Try-with-Resources statement. Java 6 and Prior static void jdk16writeFile(String path) { BufferedWriter bw = null; try { bw=new BufferedWriter(new FileWriter(path)); bw.write(&quot;JDK1.6 Need to close resource manualy.&quot;); }catch(IOException e) { e.printStackTrace(); } finally { try { bw.close(); } catch (IOException ex) { ex.printStackTrace(); } } }
  • 16. Try-with-Resources statement. Java 7 static void jdk17writeFile(String path) { try (BufferedWriter bw = new BufferedWriter(new FileWriter(path))) { bw.write(&quot;Welcome to JDK1.7 Try with resource concept&quot;); } catch(IOException ex) ‏ { System.out.println(&quot;ex&quot;+ex); } }
  • 17.
  • 18. Diamond Operator(Type Inference for Generic Instance Creation) ‏ In Java 6 and Prior List<String> jvmLanguages=new ArrayList<String>(); In Java 7 List<String> jvmLanguages=new ArrayList<>(); jvmLanguages.add(&quot;Groovy&quot;); jvmLanguages.add(&quot;Scala&quot;); System.out.println(jvmLanguages); Type Inference List<?> typeinference=new ArrayList<> ();
  • 19.
  • 20. Thank you Q&A    e-mail :muthu.svm@gmail.com blog :http://microtechinfo.blogspot.com