Java Servlets and Web Technologies Quiz
Test your knowledge of Java web programming including Applets, Servlets, and core Java concepts relevant to web development
Questions
What are the ancillary methods of javax.servlet.Servlet interface?(Choose all that apply)
- init()
- service()
- getServletContext()
- getServletConfig()
- getServletInfo()
What is true about Servlet’s service method?(Choose all that apply)
- The service() method is the heart of the servlet.
- Each request message from a client results in a single call to the servlet's service() method
- The service() method reads the request and produces the response message from its parameters
- The service() method is called to allow your servlet to clean up any resources before the servlet is unloaded.
- The InputStream from the client can be obtained via the getInputStream() method
What are the objects that are received when a servlets accepts call from client?(Choose all that apply)
- ServeltRequest
- ServletContext
- ServletResponse
- ServeltPath
- ServletConfig
What are the uses of Servlets?(Choose all that apply)
- Servlets are used to process the client request
- Servlets enables rapid development of mission-critical application that are versatile, reusable and portable across middleware while protecting IT investment
- A Servlet can handle multiple request concurrently and be used to develop high performance system
- A Servlet can be used to load balance among serveral servers, as Servlet can easily forward request
- With the help of servlet we can achieve Clustering
What is true about Servlet?(Choose all that apply)
- Run on Java enabled web browser
- Serverside Applet
- Platform independent
- Multithread processing
- Session information is maintainable with servlets
What method must be implemented by all threads?
- destroy()
- start()
- run()
- none of the above
What modifiers are allowed for methods in an Interface
- public
- private
- abstract
- protected
Objects are passed by value or by reference?
- only pass by value
- only pass by reference
- supports both
- none of the above
What are transient variables in java?
- Transient variables are variable that cannot be serialized.
- Transient variables are variable that can be serialized.
- Transient variables has no special feature
- None of the above
wait(), notify(), notifyall() are methods of which class?
- Exception
- Class
- Object
- None of the above
Which is not a phase of Applet life cycle?
- init();
- destroy();
- starts();
- stop();
What is Prepared Statements?
- Prepared statement is a precomplied SQL statement
- Prepared statement is a complied SQL statement
- Both of above
- None of the above
What is the difference between a treeset and hashset in Java?
- In a treeset data are placed in order
- In a hashset data are placed in order
- Both are same
- None of the above
What if I write static public void instead of public static void in main method?
- Runtime Error
- Compilation Error
- Program compiles and runs properly.
- None of the above
If I do not provide any arguments on the command line, then the String array of Main method will be?
- null
- empty
- cannot be determined
- None of the above
Not a phase of applet life cycle?
- start();
- service();
- init();
- destroys();