Back to Java

I have been spending time learning JavaScript over the past year or so. However now it is time to return to Java. Later this year I plan to take an advanced Java class in school. However for now I am writing some small utlities in Java.

I was surprised at how rusty I got. You need to use your skills to keep them current. I coded a simple switch statement. Being a good developer, I tried to use some constants in the labels of the switch statement. They did not work. Ooops. I forgot to make those constants "final".

There was something that surprised me a bit. I put together a switch statement that initialized a variable. I included a default label in the switch clause. So all paths through would get the variable initialized. However the compiler still gave me a warning that the variable might not be initialized.

It was a small thing. But I don't want any warnings in my code. So I had to blatantly initiallize my variable. Not so clean.