SlideShare a Scribd company logo
1 of 50
J2SE 5.0 Tiger
J2SE Road Map ,[object Object],[object Object],[object Object],JDK 1.1.4 JDK 1.1.5 JDK 1.1.6 JDK 1.1.7 JDK 1.1.8 J2SE 1.2 J2SE 1.2.1 J2SE 1.2.2 J2SE 1.3 J2SE 1.3.1 J2SE 1.4.0 J2SE 1.4.1 J2SE 1.4.2 Sparkler Pumpkin Abigail Brutus Chelsea Playground (none) Cricket Kestrel Ladybird Merlin Hopper Mantis Sept 12, 1997 Dec 3, 1997 April 24, 1998 Sept 28, 1998 April 8, 1999 Dec 4, 1998 March 30, 1999 July 8, 1999 May 8, 2000 May 17, 2001 Feb 13, 2002 Sept 16, 2002 June 26, 2003 J2SE 5.0 (1.5.0)   Tiger   Sept 29, 2004
J2SE Themes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Theme for J2SE 5.0 ,[object Object],[object Object],[object Object],[object Object],[object Object]
New Features in J2SE 5.0 ,[object Object],[object Object],[object Object],[object Object],[object Object]
New Features in J2SE 5.0 ,[object Object],[object Object],[object Object],[object Object],[object Object]
Language Features ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Generics ,[object Object],[object Object]
J2SE 1.4.0 ArrayList  intList  =  new ArrayList(); intList.add(new Integer(0)); Integer  intObj  =  (Integer) intList.get(0); J2SE 5.0 ArrayList<Integer> intList = new ArrayList<Integer>(); intList.add(new Integer(0));   //  Only Integer Objects allowed Integer  intObj  =  intList.get(0);   // No need to Type Cast
Enhanced  for  Loop ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
J2SE 1.4.0 for(Iterator iter = myArray.iterator(); iter.hasNext(); ) {     MyClass myObj = (MyClass)iter.next();     myObj.someOperation();  }  J2SE 5.0 for(MyClass myObj : myArray)  {       myObj.someOperation(); }
// Returns the sum of the elements of a int sum(int[] a)  { int result = 0; for (int i : a) result += i; return result; } For Arrays ●  Eliminates array index rather than iterator ●  Similar advantages
Variable Arguments ,[object Object],[object Object],[object Object]
public int sum(int... intList){     int i, sum;         sum=0;     for(i=0; i<intList.length; i++)  {         sum += intList[i];     }         return(sum); }   Possible ways to call this method   int arr[] = { 3,5,7 }; int result = sum (arr); int result = sum (20, 30, 10 ,5 ); int result = sum(); Example of a method that takes an arbitrary number of int arguments and returns their sum:
Boxing / Unboxing ,[object Object],[object Object],[object Object]
J2SE 1.4.0 ArrayList arrayList = new ArrayList();     Integer intObject = new Integer(10); arrayList.add(intObject);  // cannot add 10 directly   J2SE 5.0 ArrayList arrayList = new ArrayList();     arrayList.add(10);   // int 10 is automatically wrapped into Integer
Type-safe enumerations ,[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]
Static import ,[object Object]
interface ShapeNumbers {     public static int CIRCLE = 0;     public static int SQUARE = 1;     public static int TRIANGLE = 2; }  Implementing this interface creates an unnecessary dependence on the ShapeNumbers interface.  It becomes awkward to maintain as the class evolves, especially if other classes need access to these constants also and implement this interface
To make this cleaner, the static members are placed into a class and then imported via a modified syntax of the import directive . package MyConstants;     class ShapeNumbers {     public static int CIRCLE = 0;     public static int SQUARE = 1;     public static int TRIANGLE = 2; }  To import the static members in your class, specify the following in the import section of your Java source file. import static MyConstants.ShapeNumbers.*;   // imports all static data   You can also import constants individually by using the following syntax: import static MyConstants.ShapeNumbers.CIRCLE; import static MyConstants.ShapeNumbers.SQUARE;
New Features in J2SE 5.0 ,[object Object],[object Object],[object Object],[object Object],[object Object]
Virtual Machine Features ,[object Object],[object Object],[object Object],[object Object],[object Object]
Class Data Sharing ,[object Object],[object Object],[object Object],[object Object]
How CDS Works :  When JRE is installed on 32-bit platforms using the Sun provided installer, it loads a set of classes from the system jar file into a private internal representation, and dumps that representation to a file, called a &quot; shared archive &quot;.  Unix    :  jre/lib/[arch]/client/classes.jsa  Windows  :  jre/bin/client/classes.jsa  During subsequent JVM invocations, the shared archive is memory-mapped in, saving the cost of loading those classes and allowing much of the JVM's metadata for these classes to be shared among multiple JVM processes.   CDS produces better results for smaller applications because it eliminates a fixed cost of loading certain core classes .
[object Object],[object Object],[object Object],[object Object]
Server-Class Machine Detection ,[object Object],[object Object],[object Object],[object Object]
Garbage Collector Ergonomics ,[object Object],[object Object],[object Object],[object Object]
Thread Priority Changes ,[object Object],[object Object],[object Object],[object Object]
High-Precision Timing Support ,[object Object],[object Object],[object Object]
New Features in J2SE 5.0 ,[object Object],[object Object],[object Object],[object Object],[object Object]
Performance Enhancements ,[object Object],[object Object],[object Object],[object Object]
Garbage collection Ergonomics ,[object Object],[object Object],[object Object],[object Object]
StringBuilder Class ,[object Object],[object Object],[object Object]
Java 2D Technology ,[object Object],[object Object],[object Object]
Image I/O ,[object Object],[object Object]
New Features in J2SE 5.0 ,[object Object],[object Object],[object Object],[object Object],[object Object]
Base Libraries ,[object Object],[object Object],[object Object],[object Object]
Lang and Util Packages ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Lang and Util Packages  contd… ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Networking ,[object Object],[object Object],[object Object],[object Object]
JAXP 1.3 ,[object Object],[object Object],[object Object],[object Object]
Bit Manipulation Operations ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
New Features in J2SE 5.0 ,[object Object],[object Object],[object Object],[object Object],[object Object]
Integration Libraries ,[object Object],[object Object],[object Object]
Remote Method Invocation (RMI) ,[object Object],[object Object],[object Object],[object Object],[object Object]
Java Database Connectivity (JDBC) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Java Naming and Directory Interface (JNDI) ,[object Object],[object Object],[object Object]
Q & A Tiger
Thank You

More Related Content

What's hot

Ppl for students unit 4 and 5
Ppl for students unit 4 and 5Ppl for students unit 4 and 5
Ppl for students unit 4 and 5
Akshay Nagpurkar
 
iOS Multithreading
iOS MultithreadingiOS Multithreading
iOS Multithreading
Richa Jain
 

What's hot (20)

Java Tut1
Java Tut1Java Tut1
Java Tut1
 
Multithreading in java
Multithreading in javaMultithreading in java
Multithreading in java
 
Java Concurrency by Example
Java Concurrency by ExampleJava Concurrency by Example
Java Concurrency by Example
 
CS6270 Virtual Machines - Java Virtual Machine Architecture and APIs
CS6270 Virtual Machines - Java Virtual Machine Architecture and APIsCS6270 Virtual Machines - Java Virtual Machine Architecture and APIs
CS6270 Virtual Machines - Java Virtual Machine Architecture and APIs
 
Multithreading in java
Multithreading in javaMultithreading in java
Multithreading in java
 
Concurrency with java
Concurrency with javaConcurrency with java
Concurrency with java
 
Unit1 introduction to Java
Unit1 introduction to JavaUnit1 introduction to Java
Unit1 introduction to Java
 
Java multi threading
Java multi threadingJava multi threading
Java multi threading
 
Java programming basics
Java programming basicsJava programming basics
Java programming basics
 
Java concurrency
Java concurrencyJava concurrency
Java concurrency
 
MULTI THREADING IN JAVA
MULTI THREADING IN JAVAMULTI THREADING IN JAVA
MULTI THREADING IN JAVA
 
Java Course 10: Threads and Concurrency
Java Course 10: Threads and ConcurrencyJava Course 10: Threads and Concurrency
Java Course 10: Threads and Concurrency
 
Ppl for students unit 4 and 5
Ppl for students unit 4 and 5Ppl for students unit 4 and 5
Ppl for students unit 4 and 5
 
02 basic java programming and operators
02 basic java programming and operators02 basic java programming and operators
02 basic java programming and operators
 
Java memory model
Java memory modelJava memory model
Java memory model
 
Java Concurrency in Practice
Java Concurrency in PracticeJava Concurrency in Practice
Java Concurrency in Practice
 
New Features Of JDK 7
New Features Of JDK 7New Features Of JDK 7
New Features Of JDK 7
 
Tech talk
Tech talkTech talk
Tech talk
 
iOS Multithreading
iOS MultithreadingiOS Multithreading
iOS Multithreading
 
Multi threading
Multi threadingMulti threading
Multi threading
 

Viewers also liked

computer slaves
computer slavescomputer slaves
computer slaves
Alka Rao
 
Pds Web 2 0 Teacher Tube 12 8 09
Pds Web 2 0 Teacher Tube  12 8 09Pds Web 2 0 Teacher Tube  12 8 09
Pds Web 2 0 Teacher Tube 12 8 09
HPHS
 
Megan w - trail presentation
Megan w - trail presentationMegan w - trail presentation
Megan w - trail presentation
Trailplan
 
Unlocking Social CRM for your Organisation (Keynote)
Unlocking Social CRM for your Organisation (Keynote)Unlocking Social CRM for your Organisation (Keynote)
Unlocking Social CRM for your Organisation (Keynote)
Joakim Nilsson
 
Comunicare col web2.0 (Vesuviocamp 2010
Comunicare col web2.0  (Vesuviocamp 2010Comunicare col web2.0  (Vesuviocamp 2010
Comunicare col web2.0 (Vesuviocamp 2010
Luca Spoldi
 
Toronto Real Estate Board Housing Market_Charts-December_2011
Toronto Real Estate Board Housing Market_Charts-December_2011Toronto Real Estate Board Housing Market_Charts-December_2011
Toronto Real Estate Board Housing Market_Charts-December_2011
James Metcalfe
 
NEA Retired Groupsite
NEA Retired Groupsite NEA Retired Groupsite
NEA Retired Groupsite
NEA
 
technology
technologytechnology
technology
farcrys
 
SAP Roadmap in Essar Offshore Subsea Ltd.
SAP Roadmap in Essar Offshore Subsea Ltd.SAP Roadmap in Essar Offshore Subsea Ltd.
SAP Roadmap in Essar Offshore Subsea Ltd.
Pankaj K Sinha
 

Viewers also liked (20)

Enterprise Java Beans - EJB
Enterprise Java Beans - EJBEnterprise Java Beans - EJB
Enterprise Java Beans - EJB
 
2010 03-11 pmonup v3
2010 03-11 pmonup v32010 03-11 pmonup v3
2010 03-11 pmonup v3
 
computer slaves
computer slavescomputer slaves
computer slaves
 
engineering,career,how to
engineering,career,how toengineering,career,how to
engineering,career,how to
 
Pds Web 2 0 Teacher Tube 12 8 09
Pds Web 2 0 Teacher Tube  12 8 09Pds Web 2 0 Teacher Tube  12 8 09
Pds Web 2 0 Teacher Tube 12 8 09
 
Megan w - trail presentation
Megan w - trail presentationMegan w - trail presentation
Megan w - trail presentation
 
Unlocking Social CRM for your Organisation (Keynote)
Unlocking Social CRM for your Organisation (Keynote)Unlocking Social CRM for your Organisation (Keynote)
Unlocking Social CRM for your Organisation (Keynote)
 
Comunicare col web2.0 (Vesuviocamp 2010
Comunicare col web2.0  (Vesuviocamp 2010Comunicare col web2.0  (Vesuviocamp 2010
Comunicare col web2.0 (Vesuviocamp 2010
 
Toronto Real Estate Board Housing Market_Charts-December_2011
Toronto Real Estate Board Housing Market_Charts-December_2011Toronto Real Estate Board Housing Market_Charts-December_2011
Toronto Real Estate Board Housing Market_Charts-December_2011
 
The latest in advanced technical Seo
The latest in advanced technical SeoThe latest in advanced technical Seo
The latest in advanced technical Seo
 
How to make flipped classroom accessible
How to make flipped classroom accessibleHow to make flipped classroom accessible
How to make flipped classroom accessible
 
Il codice del marketing della conversazione
Il codice del marketing della conversazioneIl codice del marketing della conversazione
Il codice del marketing della conversazione
 
NEA Retired Groupsite
NEA Retired Groupsite NEA Retired Groupsite
NEA Retired Groupsite
 
Mondi virtuali, numeri e prospettive
Mondi virtuali, numeri e prospettiveMondi virtuali, numeri e prospettive
Mondi virtuali, numeri e prospettive
 
technology
technologytechnology
technology
 
SAP Roadmap in Essar Offshore Subsea Ltd.
SAP Roadmap in Essar Offshore Subsea Ltd.SAP Roadmap in Essar Offshore Subsea Ltd.
SAP Roadmap in Essar Offshore Subsea Ltd.
 
Law Uncovered - One degree many options
Law Uncovered - One degree many optionsLaw Uncovered - One degree many options
Law Uncovered - One degree many options
 
Risk Scores in Cardiac Surgery
Risk Scores in Cardiac SurgeryRisk Scores in Cardiac Surgery
Risk Scores in Cardiac Surgery
 
Presentatie informatieavond januari 2012
Presentatie informatieavond januari 2012Presentatie informatieavond januari 2012
Presentatie informatieavond januari 2012
 
How to Become an Effective Front-line Manager?
How to Become an Effective Front-line Manager?How to Become an Effective Front-line Manager?
How to Become an Effective Front-line Manager?
 

Similar to J2SE 5

Java 5 6 Generics, Concurrency, Garbage Collection, Tuning
Java 5 6 Generics, Concurrency, Garbage Collection, TuningJava 5 6 Generics, Concurrency, Garbage Collection, Tuning
Java 5 6 Generics, Concurrency, Garbage Collection, Tuning
Carol McDonald
 
Unit Testing RPG with JUnit
Unit Testing RPG with JUnitUnit Testing RPG with JUnit
Unit Testing RPG with JUnit
Greg.Helton
 
Fundamentals of oop lecture 2
Fundamentals of oop lecture 2Fundamentals of oop lecture 2
Fundamentals of oop lecture 2
miiro30
 

Similar to J2SE 5 (20)

Java 5 6 Generics, Concurrency, Garbage Collection, Tuning
Java 5 6 Generics, Concurrency, Garbage Collection, TuningJava 5 6 Generics, Concurrency, Garbage Collection, Tuning
Java 5 6 Generics, Concurrency, Garbage Collection, Tuning
 
Unit Testing RPG with JUnit
Unit Testing RPG with JUnitUnit Testing RPG with JUnit
Unit Testing RPG with JUnit
 
Unit 1 of java part 2 basic introduction
Unit 1 of java part 2 basic introduction Unit 1 of java part 2 basic introduction
Unit 1 of java part 2 basic introduction
 
Hadoop cluster performance profiler
Hadoop cluster performance profilerHadoop cluster performance profiler
Hadoop cluster performance profiler
 
Java history, versions, types of errors and exception, quiz
Java history, versions, types of errors and exception, quiz Java history, versions, types of errors and exception, quiz
Java history, versions, types of errors and exception, quiz
 
Introduction java programming
Introduction java programmingIntroduction java programming
Introduction java programming
 
Basics java programing
Basics java programingBasics java programing
Basics java programing
 
Best practices in Java
Best practices in JavaBest practices in Java
Best practices in Java
 
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)
 
Java/Servlet/JSP/JDBC
Java/Servlet/JSP/JDBCJava/Servlet/JSP/JDBC
Java/Servlet/JSP/JDBC
 
Basic java part_ii
Basic java part_iiBasic java part_ii
Basic java part_ii
 
Java 8 new features
Java 8 new features Java 8 new features
Java 8 new features
 
Java 8 new features
Java 8 new features Java 8 new features
Java 8 new features
 
Java programming concept
Java programming conceptJava programming concept
Java programming concept
 
JDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go Wrong
JDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go WrongJDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go Wrong
JDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go Wrong
 
What's new in Java EE 6
What's new in Java EE 6What's new in Java EE 6
What's new in Java EE 6
 
Introduction
IntroductionIntroduction
Introduction
 
Jvm internals
Jvm internalsJvm internals
Jvm internals
 
Fundamentals of oop lecture 2
Fundamentals of oop lecture 2Fundamentals of oop lecture 2
Fundamentals of oop lecture 2
 
basic_java.ppt
basic_java.pptbasic_java.ppt
basic_java.ppt
 

More from Luqman Shareef (10)

Containers virtaulization and docker
Containers virtaulization and dockerContainers virtaulization and docker
Containers virtaulization and docker
 
Restful webservices
Restful webservicesRestful webservices
Restful webservices
 
Scrum luqman
Scrum luqmanScrum luqman
Scrum luqman
 
Cloud computing by Luqman
Cloud computing by LuqmanCloud computing by Luqman
Cloud computing by Luqman
 
Tech Days 2010
Tech  Days 2010Tech  Days 2010
Tech Days 2010
 
Ajax
AjaxAjax
Ajax
 
Service Oriented Architecture Luqman
Service Oriented Architecture LuqmanService Oriented Architecture Luqman
Service Oriented Architecture Luqman
 
Xml by Luqman
Xml by LuqmanXml by Luqman
Xml by Luqman
 
Web Service Security
Web Service SecurityWeb Service Security
Web Service Security
 
Service Oriented Architecture
Service Oriented ArchitectureService Oriented Architecture
Service Oriented Architecture
 

Recently uploaded

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 

J2SE 5

  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9. J2SE 1.4.0 ArrayList intList = new ArrayList(); intList.add(new Integer(0)); Integer intObj = (Integer) intList.get(0); J2SE 5.0 ArrayList<Integer> intList = new ArrayList<Integer>(); intList.add(new Integer(0)); // Only Integer Objects allowed Integer intObj = intList.get(0); // No need to Type Cast
  • 10.
  • 11. J2SE 1.4.0 for(Iterator iter = myArray.iterator(); iter.hasNext(); ) {     MyClass myObj = (MyClass)iter.next();     myObj.someOperation(); } J2SE 5.0 for(MyClass myObj : myArray) {     myObj.someOperation(); }
  • 12. // Returns the sum of the elements of a int sum(int[] a) { int result = 0; for (int i : a) result += i; return result; } For Arrays ● Eliminates array index rather than iterator ● Similar advantages
  • 13.
  • 14. public int sum(int... intList){     int i, sum;         sum=0;     for(i=0; i<intList.length; i++) {         sum += intList[i];     }         return(sum); } Possible ways to call this method int arr[] = { 3,5,7 }; int result = sum (arr); int result = sum (20, 30, 10 ,5 ); int result = sum(); Example of a method that takes an arbitrary number of int arguments and returns their sum:
  • 15.
  • 16. J2SE 1.4.0 ArrayList arrayList = new ArrayList();     Integer intObject = new Integer(10); arrayList.add(intObject); // cannot add 10 directly J2SE 5.0 ArrayList arrayList = new ArrayList();     arrayList.add(10); // int 10 is automatically wrapped into Integer
  • 17.
  • 18.
  • 19.
  • 20. interface ShapeNumbers {     public static int CIRCLE = 0;     public static int SQUARE = 1;     public static int TRIANGLE = 2; } Implementing this interface creates an unnecessary dependence on the ShapeNumbers interface. It becomes awkward to maintain as the class evolves, especially if other classes need access to these constants also and implement this interface
  • 21. To make this cleaner, the static members are placed into a class and then imported via a modified syntax of the import directive . package MyConstants;     class ShapeNumbers {     public static int CIRCLE = 0;     public static int SQUARE = 1;     public static int TRIANGLE = 2; } To import the static members in your class, specify the following in the import section of your Java source file. import static MyConstants.ShapeNumbers.*; // imports all static data You can also import constants individually by using the following syntax: import static MyConstants.ShapeNumbers.CIRCLE; import static MyConstants.ShapeNumbers.SQUARE;
  • 22.
  • 23.
  • 24.
  • 25. How CDS Works : When JRE is installed on 32-bit platforms using the Sun provided installer, it loads a set of classes from the system jar file into a private internal representation, and dumps that representation to a file, called a &quot; shared archive &quot;. Unix : jre/lib/[arch]/client/classes.jsa Windows : jre/bin/client/classes.jsa During subsequent JVM invocations, the shared archive is memory-mapped in, saving the cost of loading those classes and allowing much of the JVM's metadata for these classes to be shared among multiple JVM processes. CDS produces better results for smaller applications because it eliminates a fixed cost of loading certain core classes .
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49. Q & A Tiger