I need to use Java 1.4 Map. But no templates. How to use it? What is objects? :confused:
-----------------------------------------------------------
Defence Science and Technology Organisation (DSTO)
Printable View
I need to use Java 1.4 Map. But no templates. How to use it? What is objects? :confused:
-----------------------------------------------------------
Defence Science and Technology Organisation (DSTO)
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:
Albert.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");
[...]