Also new is the keyword synchronized, reflecting the built-in support for concurrency in Java. A synchronized method excludes multiple invocations of that method, which might otherwise occur in a multi-threaded program.
The keyword final may be used to indicate that a particular value may not be changed. In this sense it is similar to the C++ keyword const. It must be noted that Java is even more elaborate in the use of the keywords private, protected and public than C++. They are used to indicate access restrictions for the methods of an object for objects inside and outside the package in which the objects' class is defined. The language features offered by Java resemble those of C++. However, in many respects Java is much simpler than C++. Most notably, the absence of pointers, a sure source of errors, makes programmers' lives easier. In particular since Java offers automatic garbage collection, programmers need not to worry about disposing objects created dynamically. Resource management, however, may be done by defining a method finalize. The counterpart, however, of that is that all objects in Java come into existence by explicit dynamic creation.
The availability of interfaces compensates for the restriction to single inheritance, which must be indicated by the keyword extends instead of the colon. It has often been argued that multiple inheritance is not really necessary. This holds true, however, only for implementation inheritance. Multiple (interface) inheritance is a powerful feature that has interesting applications once one has discovered how to use it.