Java Problems

Java is a great language. However, like any other language, it's not always intuitively obvious how to use its features to get out of a corner you've painted yourself into. This page lists some complaints people have about various Java libraries, and hopefully, will lead to solutions that we can claim to be Java Idioms.


Not sure where to put this yet, but I find it an annoying syntactical violation of Once And Only Once when the class type name is also the constructor:

Employee julie = new Employee(26);

This is common enough that some kind of shortcut should have been devised (or perhaps a long-cut if it's different).

Agreed. Tutorial Dee, for example, allows the following...

VAR julie INIT(Employee(26));

...as a short form of:

VAR julie Employee INIT(Employee(26));

A version of the Rel Project also supported:

VAR julie := Employee(26);

Java, and similar languages, could do with the equivalent.


See original on c2.com