Skip to content

Commit

Permalink
add mapTest.java
Browse files Browse the repository at this point in the history
  • Loading branch information
yaleitian committed Apr 13, 2023
1 parent f81d1f4 commit 1745008
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/main/java/test/mapTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package test;

import java.util.HashMap;
import java.util.Map;

public class mapTest {
public static void main(String[] args) {
String[] numbers = {"101", "201", "301", "401", "501", "601", "701", "801", "901", "1001", "2001"};
char[] letters = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k'};
Map<String, Character> map = new HashMap<String, Character>();

for (int i = 1; i <= numbers.length; i++) {
map.put(numbers[i-1], letters[i-1]);
}
System.out.println(map);
}
}

0 comments on commit 1745008

Please sign in to comment.