Previous: Tutorial - Classes, Up: Tutorial [Contents][Index]
import form can be used to avoid having to write
fully-qualified class names. For example:
(import (class java.util Map (HashMap HMap)))
This defines aliases for two classes in the
one with renaming:
Map is an alias for
HMap is an alias for
class keyword is needed because the
form is also used for Kawa’s module system.
See importing-class-names and Importing for details.
You can use a
(synchronized obj form1 ... formn)
This waits until it can get an exclusive lock on obj and then evaluates form1 through formn. Unlike Java, this is an expression and returns the value of formn.
You can write annotation declarations - see Annotations for details.
Kawa does not yet support annotations on types, or declaring new annotation classes.