Maps in java are very useful for storing key value pairs. Map is an interface and is a part of Collections framework. However there are many implementations of Map interface, here I am discussing only java.util.HashMap and java.util.TreeMap. java.util.HashMap uses its own hashing algorithm to save the keys (You don't have to worry about it !) . The advantages of hashmap is almost equal time consumption in retrieving the keys. Suppose we a million objects as keys in a HashMap then, it takes almost equal time in getting any key (hasmap.get(any key)). This performance comes at a price . You do not get keys in order . The order is completely decided by java. Lets take an example. Let us make Person class whose objects we will store as keys in map. So here is our Person class class Person { private int age = 0; private String name = ""; public Person(String name,int age) { this.name = name; this.age = age; } public static Person[] getPersons(){ return n...
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBoss//EN" "http://www.jboss.org/j2ee/dtd/jboss.dtd"> <jboss> <enterprise-beans> <session> <ejb-name>ejbs/sessionBeans/MyTestSession</ejb-name> <jndi-name>ejb/MyTestSession</jndi-name> </session> <message-driven> <ejb-name>ejbs/mdbs/QueueMdb</ejb-name> <destination-jndi-name>queue/B</destination-jndi-name> <resource-ref> <res-ref-name>QCF</res-ref-name> <jndi-name>ConnectionFactory</jndi-name> </resource-ref> </message-driven> <message-driven> <ejb-name>ejbs/mdbs/AnotherQueueMDB</ejb-name> <de...