In my Computer Science course, we're learning about Lookup Tables. But our teacher did not provide any examples in the lesson pages he has posted, nor the videos he provided. All he did was tell us what it was but he wants us to use them in our next assignment. But he has failed to give us examples of how to do it. We were learning about Arrays before we got into Lookup Tables. Can someone
You can use a map to store key/value pairs and lookup a value by it's key:
Map<Integer, String> map = new HashMap<>();
map.put(1, "Foo");
map.put(2, "Bar");
System.out.println(map.get(1)); // prints Foo