Aliensbrain
  • Home
  • Topics
  • Quizzes
  • Notebooks
  • Community
  • Sign in
  • programming languages Online Quiz - 280
  • Assume that there is a file called secure.txt, located at /WE...

Assume that there is a file called secure.txt, located at /WEB-INF/securefiles, whose contents are "Password=WebCert." What statements are false about the result of compiling and running the following code? 11 public class CodeTestServlet extends HttpServlet { 12 protected void doGet(HttpServletRequest request, 13 HttpServletResponse response) throws IOException { 14 ServletContext sc = getServletContext(); 15 InputStream is = sc.getResourceAsStream("/WEB-" + 16 "INF/securefiles/secure.txt"); 17 BufferedReader br = new BufferedReader(new InputStreamReader(is)); 18 System.out.println(br.readLine()); 19 } 20 }

technology programming languages
  1. The code will not compile.

  2. A RuntimeException will occur at lines 15/16

  3. An IOException will occur at line 18

  4. The string "Password=WebCert" will be returned to the requester

  5. A, B, and C above

  6. A, B, C, and D above.


Show answer
Correct Option: F

Find more quizzes:

© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy