I know these 3 different kinds of declarations:
1) ClassParent var = new ClassParent ();
2) ClassChild var = new ClassChild();
3) ClassParent var = new ClassChild();
Map<Character, Integer> hash = new HashMap<Character, Integer>();
Third case really common with collections. Could you let me know the difference between all of them, advantages, disadvantages and how you know when to use one of them over the others. Thanks