What is so great about Java 6

922 views

Published on

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 :]).

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
922
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
0
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

What is so great about Java 6

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

×