I know that in Java 8 the old
{code}
Map<String> m = new HashMap<String>();
{code}
can now be written as
{code}
Map<String> m = new HashMap<>();
{code}
But why?  I suppose in the above it is simple to figure out what is being
constructed however if the declaration of the var and the constructor are
separated is it not confusing?  Do we have a standard/guideline for this in
the Jena code?

Suppose:
{code}
MyClass<String> myClass = null;

// .... some lines later

myClass = new MyClass<>();
{code}

makes it difficult to quickly determine the type that myClass is using.
Perhaps I am just tilting at windmills, or am an old curmudgeon.

Guidance please,
Claude

.


-- 
I like: Like Like - The likeliest place on the web
<http://like-like.xenei.com>
LinkedIn: http://www.linkedin.com/in/claudewarren

Reply via email to