The Artima Developer Community
Sponsored Link

Agile Buzz Forum
OT2004 : Taming the Tiger (Java 1.5)

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Joe Walnes

Posts: 151
Nickname: jwalnes1
Registered: Aug, 2003

Joe Walnes, "The Developers' Coach" from ThoughtWorks
OT2004 : Taming the Tiger (Java 1.5) Posted: Apr 1, 2004 10:08 AM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by Joe Walnes.
Original Post: OT2004 : Taming the Tiger (Java 1.5)
Feed Title: Joe's New Jelly
Feed URL: http://joe.truemesh.com/blog/index.rdf
Feed Description: The musings of a ThoughtWorker obsessed with Agile, XP, maintainability, Java, .NET, Ruby and OpenSource. Mmm'kay?
Latest Agile Buzz Posts
Latest Agile Buzz Posts by Joe Walnes
Latest Posts From Joe's New Jelly

Advertisement

This session was presented by Benedict Heal, and he was brilliant; concise, clear, humourous and extremely chilled out. Even the fact that Josh Bloch was listening in on his presentation didn't phase him.

Most of the new Java 1.5 features are already widely known. Generics, annotations, auto-boxing, enums, syntactic sugar, yada yada yada.

Some things that caught my eye:

  • -Xlint : a compiler flag to warn you when your code can be improved to take advantage of new features such as generics.
  • Generics are not available at runtime (unlike C#).
  • Use of generics all over the API, not just collections. For example, Class is a genericised type, so newInstance() returns the correct type.
  • List cannot be given a List. Makes sense really as otherwise you'd be able to add things that it shouldn't allow.
  • Genericised types can be constrained to only allow certain type. class Blah.
  • Wildcards allow even more flexibility: List list = new ArrayList() // valid.
  • Or this: List list = new ArrayList(); // valid
  • Generics are complicated :)
  • Annotations can be specified as source level, class level (available for inspection by class loader) or runtime level (available through reflection).
  • Variable parameters to a method. Defined like this: printf(String format, Object... args). The three dots are part of the syntax! Called like this: out.printf("Blah % blah % blah", 44, "hello", someObject). Note autoboxing comes into play too.

It's only a shame there isn't a feature such as the anonymous delegate in C#... now that is real power. Rock on Java 1.8.

Read: OT2004 : Taming the Tiger (Java 1.5)

Topic: Simon Phipps, not with the program Previous Topic   Next Topic Topic: No Buffy at the end...

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use