Java code example and concepts