SlideShare a Scribd company logo
1 of 22
Java 7
came with
super power
agenda :
>   what is new in literals?
>   switch case with string
>   diamond operator in collections
>   improved exception handling
>   automatic resource management
>   new features in nio api
>   join&forks in threads
>   swing enhancements
>   dynamic-typed languages
>   proposal for etrali
>   queries ..?




      JAVA 7                     2
what is new in literals?

 numeric literals with underscore:

underscore is allowed only for the numeric.
underscore is used identifying the numeric value.

For example:
1000 will be declared as int amount = 1_000.
Then with 1million? How easy it will to understand?




   JAVA 7                       3
 binary literals for numeric:

in java6, numeric literal can declared as decimal & hexadecimal.
in java7, we can declare with binary value but it should start with “0b”
                                                                 New
for example:                                                     feature

> Int twelve = 12; // decimal
> int sixPlusSix = 0xC; //hexadecimal
> int fourTimesThree = 0b1100;.//Binary value




   JAVA 7                         4
switch case with string :

> if want the compare the string then we should use the if-else
> now in java7, we can use the switch to compare.

              JAVA6                                     JAVA7
Public void processTrade(Trade t) {       Public void processTrade(Trade t) {
String status = t.getStatus();            Switch (t.getStatus()) {
If (status.equals(“NEW”)                  Case NEW: newTrade(t);
    newTrade(t);                                      break;
Else if (status.equals(“EXECUTE”){        Case EXECUTE: executeTrader(t);
    executeTrade(t);                                 break;
Else                                      Default : pendingTrade(t);
    pendingTrade(t);                      }
}




   JAVA 7                             5
diamond operator in collections :

> java6, List<Trade> trader = new ArrayList<Trade>();
> Java7, List<Trade> trader = new ArrayList<>();

> How cool is that? You don't have to type the whole list of types for
  the instantiation. Instead you use the <> symbol, which is called
  diamond operator.

> Note that while not declaring the diamond operator is legal, as
  trades = new ArrayList(), it will make the compiler generate a
  couple of type-safety warnings.




   JAVA 7                        6
performance improved in collections :

> By using the Diamond operator it improve the performance
  increases compare to

> Performance between the JAVA5 to JAVA6 -- 15%

> Performance between the JAVA6 to JAVA7 -- 45% as be
                                             45%
  increased.

> this test percentage was given by ibm company.




   JAVA 7                      7
kicked
                                                   out
Improved exception handling :
> java 7 introduced multi-catch functionality to catch multiple
  exception types using a single catch block.
> the multiple exceptions are caught in one catch block by using a
  '|' operator.
> this way, you do not have to write dozens of exception catches.
> however, if you have bunch of exceptions that belong to different
  types, then you could use "multi -catch" blocks too.

 The following snippet illustrates this:
try {
              methodThatThrowsThreeExceptions();
     } catch (ExceptionOne e | ExceptionTwo | ExceptionThree e) {
          // log and deal with ExceptionTwo and ExceptionThree
}

   JAVA 7                       8
automatic resource management :
> resource such as the connection, files, input/output resource ect.,
  should be closed manually by developer.
> usually use try-finally block close the respective resource.
> in java7, the resource are closed automatically. By using the
  AutoCloseable interface .
> It will close resource the automatically when it come out of the try
  block need for the close resource by the developer.

try (FileOutputStream fos = new FileOutputStream("movies.txt");
         DataOutputStream dos = new DataOutputStream(fos)) {
         dos.writeUTF("Java 7 Block Buster");
  } catch (IOException e) {                                 no need to
            // log the exception                            close
                                                            resources
  }



  JAVA 7                        9
New input/output api [jsr-203] :

> the NIO 2.0 has come forward with many enhancements. It's also
  introduced new classes to ease the life of a developer when
  working with multiple file systems.

> a new java.nio.file package consists of classes and interfaces
  such as Path, Paths, FileSystem, FileSystems and others.

> File.delete(), files.deleteIfExists(path),file.move(..) & file.copy(..)
  to act on a file system efficiently.

> one of my favorite improvements in the JDK 7 release is the
  addition of File Change Notifications.


   JAVA 7                          10
> this has been a long-awaited feature that's finally carved into NIO
  2.0.
> the WatchService API lets you receive notification events upon
  changes to the subject (directory or file).

> the steps involved in implementing the API are:

1. create a WatchService. This service consists of a queue to hold
    WatchKeys
2. register the directory/file you wish to monitor with this
    WatchService
3. while registering, specify the types of events you wish to receive
    (create, modify or delete events)
4. you have to start an infinite loop to listen to events
5. when an event occurs, a WatchKey is placed into the queue
6. consume the WatchKey and invoke queries on it

   JAVA 7                        11
fork & join in thread [jsr-166] :

> What is concurrency?

> The fork-join framework allows you to distribute a certain task on
  several workers and when wait for the result.

> fork&join should extend the RecursiveAction. RecursiveAction is
  abstract class should implement the compute().

> forkJoinPool implements the core work-stealing algorithm and can
   execute forktasks.

> goal is to improve the performance of the application.


   JAVA 7                       12
dynamic-typed language[jsr-292] :

> supporting Dynamically Typed Languages on the Java
  Platform, which should ensure that dynamically typed languages
  run faster in the JVM than they did previously.

> languages like Ruby, or Groovy, will now execute on the JVM
  with performance at or close to that of native Java code

> what is static typed language?
> what is dynamic typed language?




   JAVA 7                     13
swing :

JLAYER:

> JLAYER class is a flexible & powerful decorator for swing
  components.

> It enables to draw on components & respond to component
  events without modifying the underlying component directly.




   JAVA 7                      14
java8

> Java8 [mid of 2013]
2. Language-level support for lambda expressions(->).
3. Closure [not yet confirmed]
4. Tight integration with JavaFX




                               15
Proposal for etrali on up gradation :

 what are the befits for Etrali ?
1. increasing the performance up to 20% to 50%
2. size of the code will be reduced
3. reduce heap space or memory leak exceptions
4. project life span will increase.

 what are the benefits for our organization ?
1. using the updated technologies
2. we will get some more working days on Etrali
3. profit on worked days




   JAVA 7                      16
sample code




         JDK7Samples.rar

               17
references :

> http://www.oracle.com/technetwork/articles/java/fork-
  join-422606.html
> http://docs.oracle.com/javase/tutorial/essential/concurrency/forkjo
  in.html
> http://docs.oracle.com/javase/7/docs
> http://geeknizer.com/java-7-whats-new-performance-
  benchmark-1-5-1-6-1-7/
> http://docs.oracle.com/javase/tutorial/uiswing/misc/jlayer.html
> http://rajakannappan.blogspot.in/2010/05/new-features-in-java-7-
  dolphin.html




   JAVA 7                       18
Queries




         ANY QUERIES ..?


JAVA 7            19
THANK YOU
         Thank you




Java 7
> Static typed programming languages are those in which variables
  need not be defined before they’re used. This implies that static
  typing has to do with the explicit declaration (or initialization) of
  variables before they’re employed. Java is an example of a static
  typed language; C and C++ are also static typed languages. Note
  that in C (and C++ also), variables can be cast into other types,
  but they don’t get converted; you just read them assuming they
  are another type.
> Static typing does not imply that you have to declare all the
  variables first, before you use them; variables maybe be
  initialized anywhere, but developers have to do so before they
  use those variables anywhere. Consider the following example:
> /* C code */
> static int num, sum; // explicit declaration
> num = 5; // now use the variables
   JAVA 7                          21
> sum = 10;
> http://www.sitepoint.com/typing-versus-dynamic-typing/
> Dynamic typed programming languages are those languages in
  which variables must necessarily be defined before they are
  used. This implies that dynamic typed languages do not require
  the explicit declaration of the variables before they’re used.
  Python is an example of a dynamic typed programming language,
  and so is PHP. Consider the following example:




   JAVA 7                     22

More Related Content

What's hot

What's hot (20)

Project Coin
Project CoinProject Coin
Project Coin
 
모던자바의 역습
모던자바의 역습모던자바의 역습
모던자바의 역습
 
Java and OpenJDK: disecting the ecosystem
Java and OpenJDK: disecting the ecosystemJava and OpenJDK: disecting the ecosystem
Java and OpenJDK: disecting the ecosystem
 
Jdk 7 4-forkjoin
Jdk 7 4-forkjoinJdk 7 4-forkjoin
Jdk 7 4-forkjoin
 
Bytecode manipulation with Javassist and ASM
Bytecode manipulation with Javassist and ASMBytecode manipulation with Javassist and ASM
Bytecode manipulation with Javassist and ASM
 
JVM
JVMJVM
JVM
 
Spring AOP
Spring AOPSpring AOP
Spring AOP
 
The Java memory model made easy
The Java memory model made easyThe Java memory model made easy
The Java memory model made easy
 
J2ee standards > CDI
J2ee standards > CDIJ2ee standards > CDI
J2ee standards > CDI
 
Java EE 與 雲端運算的展望
Java EE 與 雲端運算的展望 Java EE 與 雲端運算的展望
Java EE 與 雲端運算的展望
 
Java11 New Features
Java11 New FeaturesJava11 New Features
Java11 New Features
 
Java 7 & 8 New Features
Java 7 & 8 New FeaturesJava 7 & 8 New Features
Java 7 & 8 New Features
 
Smart Migration to JDK 8
Smart Migration to JDK 8Smart Migration to JDK 8
Smart Migration to JDK 8
 
Byte code field report
Byte code field reportByte code field report
Byte code field report
 
02 Hibernate Introduction
02 Hibernate Introduction02 Hibernate Introduction
02 Hibernate Introduction
 
Jersey framework
Jersey frameworkJersey framework
Jersey framework
 
The definitive guide to java agents
The definitive guide to java agentsThe definitive guide to java agents
The definitive guide to java agents
 
Java Tut1
Java Tut1Java Tut1
Java Tut1
 
Javatut1
Javatut1 Javatut1
Javatut1
 
Advance Java Programs skeleton
Advance Java Programs skeletonAdvance Java Programs skeleton
Advance Java Programs skeleton
 

Viewers also liked

Siquar báo giá 2014
Siquar báo giá 2014Siquar báo giá 2014
Siquar báo giá 2014Quang Cầu
 
DDL " disposizioni urgenti per ilrilancio dell'economia" un esempio di come n...
DDL " disposizioni urgenti per ilrilancio dell'economia" un esempio di come n...DDL " disposizioni urgenti per ilrilancio dell'economia" un esempio di come n...
DDL " disposizioni urgenti per ilrilancio dell'economia" un esempio di come n...Roberto Sorci
 
Moleskine redditi 2010
Moleskine redditi 2010Moleskine redditi 2010
Moleskine redditi 2010Roberto Sorci
 
Green Booking Riviera Romagnola - Info Alberghi
Green Booking Riviera Romagnola - Info Alberghi Green Booking Riviera Romagnola - Info Alberghi
Green Booking Riviera Romagnola - Info Alberghi Info Alberghi
 
Siquar báo giá 2014.1
Siquar báo giá 2014.1Siquar báo giá 2014.1
Siquar báo giá 2014.1Quang Cầu
 
Presentazione analisi "tempi" procedimenti amministrativi comune Fabriano
Presentazione  analisi "tempi" procedimenti amministrativi comune FabrianoPresentazione  analisi "tempi" procedimenti amministrativi comune Fabriano
Presentazione analisi "tempi" procedimenti amministrativi comune FabrianoRoberto Sorci
 
Sentenza Tar Marche per Nuova casa riposo da realizzare mediante P.F.
Sentenza Tar Marche per  Nuova casa  riposo da realizzare mediante P.F.Sentenza Tar Marche per  Nuova casa  riposo da realizzare mediante P.F.
Sentenza Tar Marche per Nuova casa riposo da realizzare mediante P.F.Roberto Sorci
 

Viewers also liked (8)

Siquar báo giá 2014
Siquar báo giá 2014Siquar báo giá 2014
Siquar báo giá 2014
 
DDL " disposizioni urgenti per ilrilancio dell'economia" un esempio di come n...
DDL " disposizioni urgenti per ilrilancio dell'economia" un esempio di come n...DDL " disposizioni urgenti per ilrilancio dell'economia" un esempio di come n...
DDL " disposizioni urgenti per ilrilancio dell'economia" un esempio di come n...
 
Moleskine redditi 2010
Moleskine redditi 2010Moleskine redditi 2010
Moleskine redditi 2010
 
Green Booking Riviera Romagnola - Info Alberghi
Green Booking Riviera Romagnola - Info Alberghi Green Booking Riviera Romagnola - Info Alberghi
Green Booking Riviera Romagnola - Info Alberghi
 
Siquar báo giá 2014.1
Siquar báo giá 2014.1Siquar báo giá 2014.1
Siquar báo giá 2014.1
 
Presentazione analisi "tempi" procedimenti amministrativi comune Fabriano
Presentazione  analisi "tempi" procedimenti amministrativi comune FabrianoPresentazione  analisi "tempi" procedimenti amministrativi comune Fabriano
Presentazione analisi "tempi" procedimenti amministrativi comune Fabriano
 
Sentenza Tar Marche per Nuova casa riposo da realizzare mediante P.F.
Sentenza Tar Marche per  Nuova casa  riposo da realizzare mediante P.F.Sentenza Tar Marche per  Nuova casa  riposo da realizzare mediante P.F.
Sentenza Tar Marche per Nuova casa riposo da realizzare mediante P.F.
 
Hotel Web Marketing
Hotel Web MarketingHotel Web Marketing
Hotel Web Marketing
 

Similar to Java7

Core Java introduction | Basics | free course
Core Java introduction | Basics | free course Core Java introduction | Basics | free course
Core Java introduction | Basics | free course Kernel Training
 
Software Uni Conf October 2014
Software Uni Conf October 2014Software Uni Conf October 2014
Software Uni Conf October 2014Nayden Gochev
 
College Project - Java Disassembler - Description
College Project - Java Disassembler - DescriptionCollege Project - Java Disassembler - Description
College Project - Java Disassembler - DescriptionGanesh Samarthyam
 
Java programming basics
Java programming basicsJava programming basics
Java programming basicsHamid Ghorbani
 
Swift 2.0: Apple’s Advanced Programming Platform for Developers
Swift 2.0: Apple’s Advanced Programming Platform for DevelopersSwift 2.0: Apple’s Advanced Programming Platform for Developers
Swift 2.0: Apple’s Advanced Programming Platform for DevelopersAzilen Technologies Pvt. Ltd.
 
JavaScript Cheatsheets with easy way .pdf
JavaScript Cheatsheets with easy way .pdfJavaScript Cheatsheets with easy way .pdf
JavaScript Cheatsheets with easy way .pdfranjanadeore1
 
Bt0074 oops with java2
Bt0074 oops with java2Bt0074 oops with java2
Bt0074 oops with java2Techglyphs
 
Java/Servlet/JSP/JDBC
Java/Servlet/JSP/JDBCJava/Servlet/JSP/JDBC
Java/Servlet/JSP/JDBCFAKHRUN NISHA
 
Java tut1 Coderdojo Cahersiveen
Java tut1 Coderdojo CahersiveenJava tut1 Coderdojo Cahersiveen
Java tut1 Coderdojo CahersiveenGraham Royce
 
Java Tutorial | My Heart
Java Tutorial | My HeartJava Tutorial | My Heart
Java Tutorial | My HeartBui Kiet
 

Similar to Java7 (20)

Core Java introduction | Basics | free course
Core Java introduction | Basics | free course Core Java introduction | Basics | free course
Core Java introduction | Basics | free course
 
Java 7 & 8
Java 7 & 8Java 7 & 8
Java 7 & 8
 
Software Uni Conf October 2014
Software Uni Conf October 2014Software Uni Conf October 2014
Software Uni Conf October 2014
 
College Project - Java Disassembler - Description
College Project - Java Disassembler - DescriptionCollege Project - Java Disassembler - Description
College Project - Java Disassembler - Description
 
Java 8 Overview
Java 8 OverviewJava 8 Overview
Java 8 Overview
 
Jsp and jstl
Jsp and jstlJsp and jstl
Jsp and jstl
 
Java programming basics
Java programming basicsJava programming basics
Java programming basics
 
What is Java? Presentation On Introduction To Core Java By PSK Technologies
What is Java? Presentation On Introduction To Core Java By PSK TechnologiesWhat is Java? Presentation On Introduction To Core Java By PSK Technologies
What is Java? Presentation On Introduction To Core Java By PSK Technologies
 
Swift 2.0: Apple’s Advanced Programming Platform for Developers
Swift 2.0: Apple’s Advanced Programming Platform for DevelopersSwift 2.0: Apple’s Advanced Programming Platform for Developers
Swift 2.0: Apple’s Advanced Programming Platform for Developers
 
JavaScript Cheatsheets with easy way .pdf
JavaScript Cheatsheets with easy way .pdfJavaScript Cheatsheets with easy way .pdf
JavaScript Cheatsheets with easy way .pdf
 
Bt0074 oops with java2
Bt0074 oops with java2Bt0074 oops with java2
Bt0074 oops with java2
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to java
 
Java Servlets & JSP
Java Servlets & JSPJava Servlets & JSP
Java Servlets & JSP
 
Java/Servlet/JSP/JDBC
Java/Servlet/JSP/JDBCJava/Servlet/JSP/JDBC
Java/Servlet/JSP/JDBC
 
Java tut1
Java tut1Java tut1
Java tut1
 
Java tut1 Coderdojo Cahersiveen
Java tut1 Coderdojo CahersiveenJava tut1 Coderdojo Cahersiveen
Java tut1 Coderdojo Cahersiveen
 
Java tut1
Java tut1Java tut1
Java tut1
 
Java Tutorial
Java TutorialJava Tutorial
Java Tutorial
 
Java Tutorial | My Heart
Java Tutorial | My HeartJava Tutorial | My Heart
Java Tutorial | My Heart
 
Java tutorial PPT
Java tutorial PPTJava tutorial PPT
Java tutorial PPT
 

Recently uploaded

Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)cama23
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfVanessa Camilleri
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptxiammrhaywood
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Food processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture honsFood processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture honsManeerUddin
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...JojoEDelaCruz
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationRosabel UA
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfPatidar M
 

Recently uploaded (20)

Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdf
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Food processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture honsFood processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture hons
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translation
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdf
 

Java7

  • 2. agenda : > what is new in literals? > switch case with string > diamond operator in collections > improved exception handling > automatic resource management > new features in nio api > join&forks in threads > swing enhancements > dynamic-typed languages > proposal for etrali > queries ..? JAVA 7 2
  • 3. what is new in literals?  numeric literals with underscore: underscore is allowed only for the numeric. underscore is used identifying the numeric value. For example: 1000 will be declared as int amount = 1_000. Then with 1million? How easy it will to understand? JAVA 7 3
  • 4.  binary literals for numeric: in java6, numeric literal can declared as decimal & hexadecimal. in java7, we can declare with binary value but it should start with “0b” New for example: feature > Int twelve = 12; // decimal > int sixPlusSix = 0xC; //hexadecimal > int fourTimesThree = 0b1100;.//Binary value JAVA 7 4
  • 5. switch case with string : > if want the compare the string then we should use the if-else > now in java7, we can use the switch to compare. JAVA6 JAVA7 Public void processTrade(Trade t) { Public void processTrade(Trade t) { String status = t.getStatus(); Switch (t.getStatus()) { If (status.equals(“NEW”) Case NEW: newTrade(t); newTrade(t); break; Else if (status.equals(“EXECUTE”){ Case EXECUTE: executeTrader(t); executeTrade(t); break; Else Default : pendingTrade(t); pendingTrade(t); } } JAVA 7 5
  • 6. diamond operator in collections : > java6, List<Trade> trader = new ArrayList<Trade>(); > Java7, List<Trade> trader = new ArrayList<>(); > How cool is that? You don't have to type the whole list of types for the instantiation. Instead you use the <> symbol, which is called diamond operator. > Note that while not declaring the diamond operator is legal, as trades = new ArrayList(), it will make the compiler generate a couple of type-safety warnings. JAVA 7 6
  • 7. performance improved in collections : > By using the Diamond operator it improve the performance increases compare to > Performance between the JAVA5 to JAVA6 -- 15% > Performance between the JAVA6 to JAVA7 -- 45% as be 45% increased. > this test percentage was given by ibm company. JAVA 7 7
  • 8. kicked out Improved exception handling : > java 7 introduced multi-catch functionality to catch multiple exception types using a single catch block. > the multiple exceptions are caught in one catch block by using a '|' operator. > this way, you do not have to write dozens of exception catches. > however, if you have bunch of exceptions that belong to different types, then you could use "multi -catch" blocks too. The following snippet illustrates this: try { methodThatThrowsThreeExceptions(); } catch (ExceptionOne e | ExceptionTwo | ExceptionThree e) { // log and deal with ExceptionTwo and ExceptionThree } JAVA 7 8
  • 9. automatic resource management : > resource such as the connection, files, input/output resource ect., should be closed manually by developer. > usually use try-finally block close the respective resource. > in java7, the resource are closed automatically. By using the AutoCloseable interface . > It will close resource the automatically when it come out of the try block need for the close resource by the developer. try (FileOutputStream fos = new FileOutputStream("movies.txt"); DataOutputStream dos = new DataOutputStream(fos)) { dos.writeUTF("Java 7 Block Buster"); } catch (IOException e) { no need to // log the exception close resources } JAVA 7 9
  • 10. New input/output api [jsr-203] : > the NIO 2.0 has come forward with many enhancements. It's also introduced new classes to ease the life of a developer when working with multiple file systems. > a new java.nio.file package consists of classes and interfaces such as Path, Paths, FileSystem, FileSystems and others. > File.delete(), files.deleteIfExists(path),file.move(..) & file.copy(..) to act on a file system efficiently. > one of my favorite improvements in the JDK 7 release is the addition of File Change Notifications. JAVA 7 10
  • 11. > this has been a long-awaited feature that's finally carved into NIO 2.0. > the WatchService API lets you receive notification events upon changes to the subject (directory or file). > the steps involved in implementing the API are: 1. create a WatchService. This service consists of a queue to hold WatchKeys 2. register the directory/file you wish to monitor with this WatchService 3. while registering, specify the types of events you wish to receive (create, modify or delete events) 4. you have to start an infinite loop to listen to events 5. when an event occurs, a WatchKey is placed into the queue 6. consume the WatchKey and invoke queries on it JAVA 7 11
  • 12. fork & join in thread [jsr-166] : > What is concurrency? > The fork-join framework allows you to distribute a certain task on several workers and when wait for the result. > fork&join should extend the RecursiveAction. RecursiveAction is abstract class should implement the compute(). > forkJoinPool implements the core work-stealing algorithm and can execute forktasks. > goal is to improve the performance of the application. JAVA 7 12
  • 13. dynamic-typed language[jsr-292] : > supporting Dynamically Typed Languages on the Java Platform, which should ensure that dynamically typed languages run faster in the JVM than they did previously. > languages like Ruby, or Groovy, will now execute on the JVM with performance at or close to that of native Java code > what is static typed language? > what is dynamic typed language? JAVA 7 13
  • 14. swing : JLAYER: > JLAYER class is a flexible & powerful decorator for swing components. > It enables to draw on components & respond to component events without modifying the underlying component directly. JAVA 7 14
  • 15. java8 > Java8 [mid of 2013] 2. Language-level support for lambda expressions(->). 3. Closure [not yet confirmed] 4. Tight integration with JavaFX 15
  • 16. Proposal for etrali on up gradation :  what are the befits for Etrali ? 1. increasing the performance up to 20% to 50% 2. size of the code will be reduced 3. reduce heap space or memory leak exceptions 4. project life span will increase.  what are the benefits for our organization ? 1. using the updated technologies 2. we will get some more working days on Etrali 3. profit on worked days JAVA 7 16
  • 17. sample code JDK7Samples.rar 17
  • 18. references : > http://www.oracle.com/technetwork/articles/java/fork- join-422606.html > http://docs.oracle.com/javase/tutorial/essential/concurrency/forkjo in.html > http://docs.oracle.com/javase/7/docs > http://geeknizer.com/java-7-whats-new-performance- benchmark-1-5-1-6-1-7/ > http://docs.oracle.com/javase/tutorial/uiswing/misc/jlayer.html > http://rajakannappan.blogspot.in/2010/05/new-features-in-java-7- dolphin.html JAVA 7 18
  • 19. Queries ANY QUERIES ..? JAVA 7 19
  • 20. THANK YOU Thank you Java 7
  • 21. > Static typed programming languages are those in which variables need not be defined before they’re used. This implies that static typing has to do with the explicit declaration (or initialization) of variables before they’re employed. Java is an example of a static typed language; C and C++ are also static typed languages. Note that in C (and C++ also), variables can be cast into other types, but they don’t get converted; you just read them assuming they are another type. > Static typing does not imply that you have to declare all the variables first, before you use them; variables maybe be initialized anywhere, but developers have to do so before they use those variables anywhere. Consider the following example: > /* C code */ > static int num, sum; // explicit declaration > num = 5; // now use the variables JAVA 7 21 > sum = 10;
  • 22. > http://www.sitepoint.com/typing-versus-dynamic-typing/ > Dynamic typed programming languages are those languages in which variables must necessarily be defined before they are used. This implies that dynamic typed languages do not require the explicit declaration of the variables before they’re used. Python is an example of a dynamic typed programming language, and so is PHP. Consider the following example: JAVA 7 22

Editor's Notes

  1. JAVA7
  2. JAVA7
  3. JAVA7
  4. JAVA7
  5. JAVA7
  6. JAVA7
  7. JAVA7
  8. JAVA7
  9. JAVA7
  10. JAVA7
  11. JAVA7
  12. JAVA7
  13. JAVA7
  14. JAVA7
  15. JAVA7
  16. JAVA7
  17. JAVA7