Java Servlets and Web Technologies Quiz

Test your knowledge of Java web programming including Applets, Servlets, and core Java concepts relevant to web development

16 Questions Published

Questions

Question 1 Multiple Choice (Multiple Answers)

What are the ancillary methods of javax.servlet.Servlet interface?(Choose all that apply)

  1. init()
  2. service()
  3. getServletContext()
  4. getServletConfig()
  5. getServletInfo()
Question 2 Multiple Choice (Multiple Answers)

What is true about Servlet’s service method?(Choose all that apply)

  1. The service() method is the heart of the servlet.
  2. Each request message from a client results in a single call to the servlet's service() method
  3. The service() method reads the request and produces the response message from its parameters
  4. The service() method is called to allow your servlet to clean up any resources before the servlet is unloaded.
  5. The InputStream from the client can be obtained via the getInputStream() method
Question 3 Multiple Choice (Multiple Answers)

What are the objects that are received when a servlets accepts call from client?(Choose all that apply)

  1. ServeltRequest
  2. ServletContext
  3. ServletResponse
  4. ServeltPath
  5. ServletConfig
Question 4 Multiple Choice (Multiple Answers)

What are the uses of Servlets?(Choose all that apply)

  1. Servlets are used to process the client request
  2. Servlets enables rapid development of mission-critical application that are versatile, reusable and portable across middleware while protecting IT investment
  3. A Servlet can handle multiple request concurrently and be used to develop high performance system
  4. A Servlet can be used to load balance among serveral servers, as Servlet can easily forward request
  5. With the help of servlet we can achieve Clustering
Question 5 Multiple Choice (Multiple Answers)

What is true about Servlet?(Choose all that apply)

  1. Run on Java enabled web browser
  2. Serverside Applet
  3. Platform independent
  4. Multithread processing
  5. Session information is maintainable with servlets
Question 6 Multiple Choice (Single Answer)

What method must be implemented by all threads?

  1. destroy()
  2. start()
  3. run()
  4. none of the above
Question 7 Multiple Choice (Multiple Answers)

What modifiers are allowed for methods in an Interface

  1. public
  2. private
  3. abstract
  4. protected
Question 8 Multiple Choice (Single Answer)

Objects are passed by value or by reference?

  1. only pass by value
  2. only pass by reference
  3. supports both
  4. none of the above
Question 9 Multiple Choice (Single Answer)

What are transient variables in java?

  1. Transient variables are variable that cannot be serialized.
  2. Transient variables are variable that can be serialized.
  3. Transient variables has no special feature
  4. None of the above
Question 10 Multiple Choice (Single Answer)

wait(), notify(), notifyall() are methods of which class?

  1. Exception
  2. Class
  3. Object
  4. None of the above
Question 11 Multiple Choice (Single Answer)

Which is not a phase of Applet life cycle?

  1. init();
  2. destroy();
  3. starts();
  4. stop();
Question 12 Multiple Choice (Single Answer)

What is Prepared Statements?

  1. Prepared statement is a precomplied SQL statement
  2. Prepared statement is a complied SQL statement
  3. Both of above
  4. None of the above
Question 13 Multiple Choice (Single Answer)

What is the difference between a treeset and hashset in Java?

  1. In a treeset data are placed in order
  2. In a hashset data are placed in order
  3. Both are same
  4. None of the above
Question 14 Multiple Choice (Single Answer)

What if I write static public void instead of public static void in main method?

  1. Runtime Error
  2. Compilation Error
  3. Program compiles and runs properly.
  4. None of the above
Question 15 Multiple Choice (Single Answer)

If I do not provide any arguments on the command line, then the String array of Main method will be?

  1. null
  2. empty
  3. cannot be determined
  4. None of the above
Question 16 Multiple Choice (Single Answer)

Not a phase of applet life cycle?

  1. start();
  2. service();
  3. init();
  4. destroys();