Online Hibernate Training just in Rs. 1000

One week online training in Hibernate ORM framework. Learn Hibernate Framework and enhance your skills. Best Online Hibernate training at 90% discount. Join Now!! Offer is valid Only for limited Period!!! Online Training Big Data and Hadoop Training Java Training  




Share on Google+Share on Google+

2 Answer(s)      6 years and 8 months ago
Posted in : Java Beginners

using map, i want display message based on id selected [both are strings]

View Answers

December 23, 2010 at 11:38 AM

i do no

December 23, 2010 at 12:59 PM

Hi Friend,

Try the following code:

import java.util.*;
class MapExample
    public static void main(String[] args) 
        Map map=new HashMap();
        map.put("Message2","Hello World");
        map.put("Messgae3","All glitters are not gold");
        map.put("Message4","Where there is will, there is a way");

        String id = (String) map.get("Message1");        



Related Tutorials/Questions & Answers:
map  using map, i want display message based on id selected [both are strings]   i do no   Hi Friend, Try the following code...) { Map map=new HashMap(); map.put("Message1","Hello
Map  If I have an object implementing the Map interface in Java and I wish to iterate over every pair contained within it, what is the most efficient way of going through the map either iterator or for each loop or for loop
Map interface
Map interface  What is the Map interface
Hash Map
Hash Map  how to add the hash map objects in the list and iterate the objects
Interactive map
Interactive map  hi........ i require map to be zoom in and enlarge the area and show its detail. Can anyone tel me how can this be done using java swings .... plz help
Map code
Map code  hi................ I have map of navi mumbai, where i want to see the location vashi, nerul, turbhe.... means want to zoom into this area and then again zoom in and see nerul location more properly or other location
hash map
hash map  write a program in hash map , that shows the value in asending order. but not key value. ex: key value ==== ===== k5 ashutosh k1 babita k7 debasis k2 vikas plz help me
hash map
=2; HashMap<Integer,Test> map=new HashMap<Integer,Test>
Iterate Tag used with a Map.
Iterate Tag used with a Map.  How Iterate Tag used with a Map
Map java Object to database.
Map java Object to database.  How do you map Java Objects with Database tables
solution of k map in c
solution of k map in c  write a program in c to solve k-map with digital circuit
parse map in java
parse map in java  What is a Parser? Can you give the source code to parse map in Java
about google map
about google map  how to add google map in website
about google map
about google map  how to add google map in website
add google map javascript
add google map javascript  How can i add google map using javascript in my web page?   Search for the " Google Maps Javascript API" it will allow you to embed the Google Map into your web Page
map on web page
map on web page   i want to insert an area map in my web page how can i do it ? please answer me soon. Its urgent
Google Map Integration - Ajax
Google Map Integration  Hi All, I am working on a vehicle tracking system project. I have to read data from sql server database and map the vehicle position in google map. I need to use ajax as the data is updated in every
Stoting file name in Map
Stoting file name in Map  how to store id and file name in map
ApplicationDevelopment Using Google Map
ApplicationDevelopment Using Google Map  I want application using google map please guide me how can i develop
Store ResultSt Data in a Map
Store ResultSt Data in a Map  i want to store data in a hash Map .Please solve my problem as soon as possible
Java Map Example
Java Map Example  How we can use Map in java collection?   The Map interface maps unique keys to value means it associate value to unique...(String[] args) { Map mp = new HashMap(); mp.put(new Integer(2
How to hold data in map
How to hold data in map  Holding data in map: i have user1 and he has account1,account2,accoutn3 like that user2,user3 will have accounts. now how to hold users and their accounts in hashmap
J2me Map load error
J2me Map load error  Hi , i am making a POC to load google map in my mobile,now i m getting the address of location by its lattitude and longitude in web page , but thing is i wana to store in my net beans emulator , its showing
java code for PartialSearch using Map????
java code for PartialSearch using Map????  java code for Partial Search using Map
In this section, you will learn about attribute 'alias_to_entity_map' of method 'setResultTransformer' which converts each row of result into a Map
Java tree map trouble
Java tree map trouble  This is a project for a class, and I am totally stuck! I've created a tree map using an input text file. I split the lines into fields so that I could work with 2 elements from the file. It appears
Version of com.graphhopper>map-matching dependency
List of Version of com.graphhopper>map-matching dependency
Site map - C Tutorials
Index  | About-us | Contact Us | Advertisement | Ask Questions | Site Map | Business Software Services India Tutorial Section   C Tutorials  | Java Tutorials | PHP Tutorials  | Linux
Java Map
Java Map         In Java, a Map is a kind of generalized array. It provides a more general way of storing elements. It is an object that maps keys to values. Map
Using of [] operator of EL with the Map
Using [ ] operator of EL with the Map   ... Map key or a bean property name as well as the access to arrays and Lists. Map stores the values in the form of a key- value pair. Map can't have a duplicate