M
Matt
In the following code, I need the best practice is (1), but I still
don't understand why. So the rule of thumb is if possible, it is best
to create an instance of a class that pointed to by interface of that
class?
HashMap m = new HashMap(); --(1)
Map m = new HashMap(); -- (2)
Please advise. Thanks!
don't understand why. So the rule of thumb is if possible, it is best
to create an instance of a class that pointed to by interface of that
class?
HashMap m = new HashMap(); --(1)
Map m = new HashMap(); -- (2)
Please advise. Thanks!