Your SlideShare is downloading. ×
What is so great about Java 6
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

What is so great about Java 6

655

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

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
655
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

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

×