What will be the output of the following program?
import java.util.HashMap;
import java.util.Map;
public class Program {
public static void main(String... args) {
Key k1 = new Key();
Key k2 = new Key();
Map
map.put(k1, "value1");
map.put(k2, "value2");
System.out.println(map.get(k1));
System.out.println(map.get(k2));
}
}
class Key {
public int hashCode() {
return (int)(Math.random() * 100);
}
}
a. null
null
b. value1
value2
c. value2
value2
d. A Runtime Exception will be thrown.
a. null
null
You might also like to view...
Josh is a student who works on PowerPoint. He creates a presentation that uses many bulleted points. He notices that some of the points are not in logical order. Instead of deleting the points and typing them over, Josh can switch to the _____ pane and rearrange the points.?
A. ?Outline B. ?Slides C. ?Notes D. ?Selection
In order to share a presentation online using the Share option, you must have a Microsoft account
Indicate whether the statement is true or false
Predicates are special types of function objects that return Boolean values.
Answer the following statement true (T) or false (F)
In a processor with a five stage pipeline as discussed in the class and shown in the picture below (with buffers between the stages), explain the problem posed by branch instruction. Present a solution.
What will be an ideal response?