Hacker News new | ask | show | jobs
by acqq 4499 days ago
Is Java still lacking constructs like

     var thingy = FactoryFactoryObjectThingymybobProducer
The compiler actually knows what type is on the right of the = sign. Having to write FactoryFactoryObjectThingymybobProducer is not good for anything.
1 comments

Usually this is not what you want to separate interfaces from implementations. For example, this:

    List<T> l = new ArrayList<T>();
is preferred to this:

    ArrayList<T> l = new ArrayList<T>();
Of course, it would be nice for the compiler to assume the latter if no type is specified on the left side.