-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDrillMap.java
More file actions
19 lines (12 loc) · 772 Bytes
/
DrillMap.java
File metadata and controls
19 lines (12 loc) · 772 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import java.util.LinkedHashMap; //Import LinkedHashMap
public class DrillMap { //Declaration of DrillMap class
public static LinkedHashMap<String, Integer> getDrillCost(){ //LinkedHashMap, the components will be replaced in the sequence in which they were inserted.
LinkedHashMap<String, Integer> getDrillCost = new LinkedHashMap <String, Integer>(); //Create a LinkedHashMap
getDrillCost.put("Light", 100000); //Put key and value in the map
getDrillCost.put("Special", 250000); //Put key and value in the map
getDrillCost.put("Heavy", 500000); //Put key and value in the map
return getDrillCost; //Return values of each key
}
}
/*Code to use to access from different class
Integer value = DrillMap.getDrillCost().get("Light")*/