Map map = new HashMap(2);
map.add(“1”,”one”);
map.add(“2”,”two”);
map.add(“3”,”three”); What will happen at this line?
Answer Posted / raman t
if we write like this then it would be better.
HashMap map = new HashMap();
map.add( "cat", "Meow" );
map.add( "ape", "Squeak" );
map.add( "dog", "Woof" );
map.add( "bat", "Squeak" );
System.out.println( "map = " + map );
| Is This Answer Correct ? | 2 Yes | 14 No |
Post New Answer View All Answers
What is an i/o filter?
What does the @override annotation do?
What are the disadvantages of object oriented programming?
How many bytes is a unicode character?
What is the concatenation operator in java?
What's the access scope of protected access specifier?
What is difference between float and double?
what is mutual exclusion? : Java thread
What is wrapper class example?
what are three ways in which a thread can enter the waiting state? : Java thread
Can an interface implement another interface?
What is a classloader in java?
What is parsing in java?
What are the approaches that you will follow for making a program very efficient?
How to display arraylist values in java?