单项选择题

System.out.println(Math.sqrt(-4D));  What is the result?()  

A. –2
B. NaN
C. Infinity
D. Compilation fails.
E. An exception is thrown at runtime.