Multiple choice technology programming languages

What will be the result of running the following jsp file taking into account that the Web server has just been started and this is the first page loaded by the server? <%= request.getSession(false).getId() %>

  1. 1)It won't compile

  2. 2)It will print the session id.

  3. 3)It will produce a NullPointerException as the getSession(false) method's call returns null, cause no session had been created.

  4. 4)It will produce an empty page.

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Calling request.getSession(false) when no session currently exists returns null. Attempting to call .getId() on that null reference immediately triggers a NullPointerException.