• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
What is so great about Java 6
 

What is so great about Java 6

on

  • 618 views

A translation from polish of my presentation about Java 6. It can be used for encouraging a upgrade of a legacy system or to train your team (as I did :]).

A translation from polish of my presentation about Java 6. It can be used for encouraging a upgrade of a legacy system or to train your team (as I did :]).

Statistics

Views

Total Views
618
Views on SlideShare
618
Embed Views
0

Actions

Likes
1
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    What is so great about Java 6 What is so great about Java 6 Presentation Transcript

    • 1
    • Plan1. Example: from Java 1.4 to Java 1.62. Problems3. Additional features 2
    • Code before Java 5/6 3
    • Simple for loop 4
    • Enhanced for loop 5
    • After the first enhancement Untouched part Enhanced part 6
    • Creating instances of Integer 7
    • AutoboxingWorks for: Boolean Byte Short Character Integer Long Float Double 8
    • Autoboxing usage 9
    • What about… 10
    • …type-safety 11
    • ClassCastException 12
    • Generics 13
    • Ensuring type-safety 14
    • Compilation exception 15
    • Enhanced for + generics 16
    • Code getting better… 17
    • Can it be shortened? 18
    • Simple usage 19
    • Static import 20
    • Static import of the System class 21
    • Creating a list Code duplication 22
    • Desired outcome 23
    • First thought 24
    • Varargs 25
    • Creating a list with varargs 26
    • Generics + varargs 27
    • Time for a comparison… 28
    • BeforeAfter 29
    • Problems1. Inheritance and generics2. Class to be used with the enhanced for loop3. Watch out! Autoboxing in a loop4. When use the static import?5. Rules for Varargs 30
    • Inheritance and generics 31
    • Iterating over domain class 32
    • Iterable<T> interface 33
    • Watch out! Autoboxing in a loop 34
    • How it really works… 35
    • 36
    • When use the static import? …firstly, try not to overuse it it works well if it makes your code more readable and DRY, i.e.:  JUnit 4 (org.junit.Assert.*);  Mockito (org.mockito.Mockito.*); 37
    • Static import (JUnit 4) 38
    • Static import (Mockito) 39
    • Rules for varargs 40
    • Additional features Enums Annotations 41
    • Simple enum 42
    • Enum is a class 43
    • Annotations…first lets get back to EJB 2……what is needed for a session bean in EJB 2? 44
    • Component interface 45
    • Home interface 46
    • Component class 47
    • ejb-jar.xml – dependencies 48
    • ejb-jar.xml – transactions 49
    • The same thing, but with EJB 3 50
    • The End 51