This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
There isn't enough information here. We don't know what this "arrList" is, and what you placed into it. We don''t know what you have in "mapvar" either... so I am not sure how we can explain whether the "if" condition should succeed or not.
Joined: Feb 03, 2009
I am sorry for not providing proper information.
Please find the following information.
Map<String,ArrayList<String>> mapvar = new LinkedHashMap<String,ArrayList<String>>();
mapVar is of type String and ArrayList it consists of mapVar(key1,value1) where key1=k1,k2,k3; value1=name1,name2,name3 and
ArrayList<String> arrList = new ArrayList<String>();
arrList.add(values); of type String where values=k1,k2,k3;
I am trying to compare and add all the names comes under that key in a array list.but it is not entering into the condition.
System.out.println("arrList after comparision:"+arrList.get(i));
Yes, you are right.when I tried to print above the loop I am able to get all the array list values but I am unable to get the values after that loop because it is not passing through that condition I guess.