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.

Post a comment in response:

(will be screened)
(will be screened if not validated)
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org