1. Can you extend main method in Java? 2. Explain how hashmap works internally? 3. Relation between hash code and equals? 3. Difference between StringBuffer/StringBuilder? 4. Code to check the frequency of word occurrence? 5.Code to implement a country/state list generation logic? Follow-up - country name can have aliases 6.Spring bean wiring.
Anonymous
public static HashMap funcString(String input) { HashMap m = new HashMap(); for (int i = 0; i < input.length(); i++) { char x = input.charAt(i); Integer val = m.get(x); if (val != null) { m.put(x, val + 1); } else m.put(x, 1); } return m ; }
Check out your Company Bowl for anonymous work chats.