Answer Posted / venkat
yes we can add object in Hashmap
like the example is
ArrayList list=new ArrayList();
list.add(10);
HashMap map=new HashMap();
map.put(list,"13");
here list is object
Is This Answer Correct ? | 15 Yes | 0 No |
Post New Answer View All Answers
How do you use find and replace?
Can a static method be final?
Is this valid in java ? Can we instantiate interface in java?
What is a private class in java?
What is arguments in java?
public class Test { public static void main(String[] args) { int countA = 0; int countB = 0; int countC = 0; int countD = 0; int countE = 0; int countF = 0; int countG = 0; int countH = 0; int countI = 0; int countJ = 0; int countK = 0; int countL = 0; int countM = 0; int countN = 0; int countO = 0; int countP = 0; int countQ = 0; int countR = 0; int countS = 0; int countT = 0; int countU = 0; int countV = 0; int countW = 0; int countX = 0; int countY = 0; int countZ = 0; } } Can anybody tell me any alternate solution(like loop or something) to automate this initialization process. Ex:- for(char chr='A';chr<='Z'; chr++) { (int) String "count"+chr = 0; }
What is the default size of load factor in hashing based collection?
What is methods in java?
What is polymorphism and what are the types of it?
Can a list be null in java?
What are the advantages of user defined functions?
What are the differences between string and stringbuffer?
What are the advantages of passing this into a method instead of the current class object itself?
can java object be locked down for exclusive use by a given thread? Or what happens when a thread cannot acquire a lock on an object? : Java thread
What does nextint () do in java?