What is the result of executing the following code? (Choose all that apply.)
String line;
Console c = System.console();
if ((line = c.readLine()) != null)
System.out.println(line);
B, D.
Option B is correct because this is the right way to read data from the Console.
Option D is also correct.
If there is no console available, a NullPointerException is thrown.
The read method does not throw an IOException.