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 boolean equals(Object o) {
return true;
}
public int hashCode() {
return 1;
}
}
a. value2
value2
b. null
null
c. value1
value2
d. A Runtime Exception will be thrown.
a. value2
value2
You might also like to view...
MC Each module’s global namespace contains an identifier called______that states the module’s name.
a) (name). b) _name_. c) __name__. d) None of the above.
Stream mutable reduction operation ________ creates a new collection of elements containing the results of the stream’s prior operations.
a. combine b. accumulate c. gather d. collect
In general, you begin most modifications by _____ the chart element you want to change.
Fill in the blank(s) with the appropriate word(s).
If you want to separate the field "Beginning to Ending Inventory," which is currently a range of two numbers, to two different fields, your first step should be to:
A) change the primary key. B) insert a field. C) click the "Separate field" button. D) delete the field.