The following is a declaration of a
boolean field named
initialized, and its use in a method named
|Code section 1: Connection synchronization.
The previous code only creates a connection once (at the first method call). Note that there is no automatic conversion between integer types (such as
boolean as is possible in some languages like C. Instead, one must use an equivalent expression such as
(i != 0) which evaluates to
i is not zero.