|
|
400 Mock Questions on SCJP 1.6 - JUST Rs.250 or 10 USD
Send us mail to sales@javabeat.net
more details
|
Do you have paypal account? Click Here to pay now and get the questions.
|
|
SCJP 1.6 Mock Exams - NavigableMap (10 Questions)
2) What will be the output of the following program?
package navmap;
import java.util.HashMap;
import java.util.NavigableMap;
import java.util.TreeMap;
public class Ques01 {
public static void main(String[] args) {
NavigableMap<String, String> colors = new HashMap<String, String>();
colors.put("RED", "Red");
colors.put("BLUE", "Blue");
System.out.println(colors.get("BLUE"));
}
}
- The program will output 'null'.
- The program will return 'Blue'.
- The program won't compile because of compilation errors.
- The program will throw a run-time exception.
Answer
2) c.
The program won't compile since the class HashMap doesn't implement the NavigableMap interface.
|
|
400 Mock Questions on SCJP 1.6 - JUST Rs.250 or 10 USD
Send us mail to sales@javabeat.net
more details
|
|