l33tminion: Enter the l33tness (Matrix Largo)
Sam ([personal profile] l33tminion) wrote2008-04-08 09:23 pm
Entry tags:

Cancer of the Semicolon

The following is only relevant to the programmers on my friends list, probably...

So, did you know that Java has syntactic sugar for iterating over a collection? So you can write this:
for (SomeType item: stuff) {
    // code here
}
Instead of:
for (Iterator<SomeType> iter = stuff.iterator(); iterator.hasNext();) {
    SomeType item = iter.next()
    // code here
}
I didn't until recently. When did that happen? Was that not around when I was first learning Java?

Despite that, I'm feeling more competent Java-wise lately. I feel that I finally understand the JNI (how to use it, anyways). I even got a C++ API for the multitouch hardware I'm using to play nicely with some Java code.
ext_81047: (Default)

[identity profile] kihou.livejournal.com 2008-04-09 01:43 am (UTC)(link)
That got added in Java 5, so after the AP test, at least. Don't know how much Java you've done since then.