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 JavaIdioms.


Not sure where to put this yet, but I find it an annoying syntactical violation of OnceAndOnlyOnce 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. TutorialDee, 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 RelProject also supported:

 VAR julie := Employee(26);
Java, and similar languages, could do with the equivalent.


CategoryJava, IsDot, JavaDesignFlaws, JavaPatterns


EditText of this page (last edited September 30, 2012) or FindPage with title or text search