J
jan V
In a recent post I saw this line of code:
If we ignore the use of generics, we can rephrase this as
This code violates the principle that you should declare your variables to
be interface types, if at all possible (as per Joshua Bloch's
recommendations).
Does using generics make following this principle harder, or did the
original author of the above code simply not follow the rule?
ArrayList<String> _hidden = new ArrayList<String>();
If we ignore the use of generics, we can rephrase this as
ArrayList _hidden = new ArrayList();
This code violates the principle that you should declare your variables to
be interface types, if at all possible (as per Joshua Bloch's
recommendations).
Does using generics make following this principle harder, or did the
original author of the above code simply not follow the rule?