Ben Chuanlong Du's Blog

It is never too late to learn.

Enumeration in Java

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

  1. You can associate values with enumeration elements.

Variables in Java

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

  1. There are 3 different types of variables in Java: instance variables, local variables and argument variables. An instance variables will be initialized to default values if it is not initialized manually …

Java Features

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

  1. String in Switch

Java 7 allows use of strings in switch instead of just integers, which make things much more convenient (see the following example).

public void foo(Foo t) {
    String …