Question: ou need to create a dictionary in Java representing student IDs and the student objects. The key would be an integer representing the student ID
ou need to create a dictionary in Java representing student IDs and the student objects. The key would be an integer representing the student ID the value would be a Student instance, and there would be standard dictionary methods lookup an item by key, adding an item, etc. Describe the quickest way to implement this logic.:
A You would import the java.util package and use the Dictionary class.
B You would create a pair class with key and value members, create an array of pair objects, and then implement the various dictionary methods on that array.
C You would declare a multidimensional array where rows had integer values representing the keys and columns had Student values. Then implement the various dictionary methods.
D Create your own dictionary package using only primitive data types and the Student class.
E There is no way to implement a dictionary in Java.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
