-
June 14th, 2012, 04:38 AM
#1
How to use Map
I need to use Java 1.4 Map. But no templates. How to use it? What is objects?
-----------------------------------------------------------
Defence Science and Technology Organisation (DSTO)
-
June 14th, 2012, 06:16 AM
#2
Re: How to use Map
There are no templates in Java 1.4, which are called 'Generics'. They are part of Java 1.5.
What do you mean by "What is objects?"? There are thousands of sites to find out how to use a Map.
Anyway, a simple example:
Code:
// Create
Map myMap = new HashMap();
// Set data
myMap.put("1", "One");
myMap.put("2", "Two);
myMap.put("3", "Three");
//Get data
String name = (String) myMap.get("1");
[...]
Albert.
Please, correct me. I'm just learning.... and sorry for my english :-)
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|