Example: barber

Servlets Mock Test I - Tutorialspoint

mock TESTSERVLETS mock TESTThis section presents you various set of mock tests related to Servlets Framework. You candownload these sample mock tests at your local machine and solve offline at your mock test is supplied with a mock test key to let you verify the final score and grade mock TEST ISERVLETS mock TEST IQ 1 - What are Servlets ?A - Java Servlets are programs that run on a Web or Application - Java Servlets act as a middle layer between a request coming from a Web browser or otherHTTP client and databases or applications on the HTTP - Both of the - None of the 2 - Which of the following is true about Servlets ?A - Servlets execute within the address space of a Web - Servlets are platform-independent because they are written in - The full functionality of the Java class libraries is available to a - All of the 3 - Which of the following package contains servlet classes?

Every mock test is supplied with a mock test key to let you verify the final score and grade yourself. SSEERRVVLLEETTSS MMOOCCKK TTEESSTT II Q 1 - What are Servlets? A - Java Servlets are programs that run on a Web or Application server.

Tags:

  Tests, Mock, Tutorialspoint, Mock test

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Advertisement

Transcription of Servlets Mock Test I - Tutorialspoint

1 mock TESTSERVLETS mock TESTThis section presents you various set of mock tests related to Servlets Framework. You candownload these sample mock tests at your local machine and solve offline at your mock test is supplied with a mock test key to let you verify the final score and grade mock TEST ISERVLETS mock TEST IQ 1 - What are Servlets ?A - Java Servlets are programs that run on a Web or Application - Java Servlets act as a middle layer between a request coming from a Web browser or otherHTTP client and databases or applications on the HTTP - Both of the - None of the 2 - Which of the following is true about Servlets ?A - Servlets execute within the address space of a Web - Servlets are platform-independent because they are written in - The full functionality of the Java class libraries is available to a - All of the 3 - Which of the following package contains servlet classes?

2 A - - - Both of the - None of the 4 - Which of the following is the correct order of servlet life cycle phase methods?A - init, service, destroyB - initialize, service, destroyC - init, execute, destroyD - init, service, deleteQ 5 - When init method of servlet gets called?A - The init method is called when the servlet is first - The init method is called whenever the servlet is - Both of the - None of the 6 - Which of the following is true about init method of servlet?A - The init method simply creates or loads some data that will be used throughout the life of - The init method is not called again and again for each user - Both of the - None of the 7 - When service method of servlet gets called?A - The service method is called when the servlet is first - The service method is called whenever the servlet is - Both of the - None of the 8 - Which of the following is true about service method of servlet?

3 A - The servlet container calls the service method to handle requests coming fromthe - Each time the server receives a request for a servlet, the server spawns a new thread andcalls - The service method checks the HTTP request type GET,POST,PUT,DELETE,etc. and callsdoGet, doPost, doPut, doDelete, etc. methods as - All of the 9 - When doGet method of servlet gets called?A - A GET request results from a normal request for a - The service method checks the HTTP request type as GET and calls doGet - Both of the - None of the 10 - When doPost method of servlet gets called?A - A POST request results from an HTML form that specifically lists POST as the - The service method checks the HTTP request type as POST and calls doPost - Both of the - None of the 11 - When destroy method of servlet gets called?

4 A - The destroy method is called only once at the end of the life cycle of a - The destroy method is called after the servlet has executed service - Both of the - None of the 12 - Which of the following is true about destroy method of servlet?A - After the destroy method is called, the servlet object is marked for garbage - The servlet is terminated by calling the destroy - Both of the - None of the 13 - What is - interfaceB - abstract classC - concreate classD - None of the 14 - What is - interfaceB - abstract classC - concreate classD - None of the 15 - Which of the following is true about HTTP Get method?A - The GET method sends the encoded user information appended to the page - The GET method is the defualt method to pass information from browser to web - Both of the - None of the 16 - Which of the following is true about HTTP Post method?

5 A - The POST method sends the encoded user information as a seperate message to - The POST method is used to submit form data - Both of the - None of the 17 - Which of the following method can be used to get the value of form parameter?A - - - - None of the 18 - Which of the following method can be used to get the multiple values of aparameter like checkbox data?A - - - - None of the 19 - Which of the following method can be used to get complete list of allparameters in the current request?A - - - - None of the 20 - Which of the following code is used to set content type of a page to be servicedusing servlet?A - - - - None of the 21 - Which of the following code is used to get PrintWriter object in servlet?A - - - new PrintWriterD - None of the 22 - Which of the following code is used to get cookies in servlet?

6 A - - - - None of the 23 - Which of the following code is used to get names of the attributes in servlet?A - - - - None of the 24 - Which of the following code is used to get names of the headers in servlet?A - - - - None of the 25 - Which of the following code is used to get names of the parameters in servlet?A - - - - None of the 26 - Which of the following code is used to get session in servlet?A - - - new SessionD - None of the 27 - Which of the following code is used to get locale in servlet?A - - - new LocaleD - None of the 28 - Which of the following code is used to get a particular attribute in servlet?A - - - new AttributenameD - None of the 29 - Which of the following code retrieves the name of the authentication scheme?A - new AuthTypeB - - - None of the 30 - Which of the following code retrieves the body of the request as binary data?

7 A - new InputStreamB - - - None of the 31 - Which of the following code retrieves the character encoding used in the bodyof this request?A - new CharacterEncodingB - - - None of the 32 - Which of the following code retrieves the MIME type of the body of the request?A - new MimeTypeB - - - None of the 33 - Which of the following code retrieves the context of the request?A - new ClassContextPathB - - - None of the 34 - Which of the following code retrieves the request header?A - - - - None of the 35 - Which of the following code retrieves the name of the HTTP Method?A - - - - None of the 36 - Which of the following code retrieves the value of a request parameter?A - - - - None of the 37 - Which of the following code retrieves any extra path information associatedwith the URL the client sent?

8 A - - - - None of the 38 - Which of the following code retrieves name and version of the protocol?A - - - - None of the 39 - Which of the following code retrieves the query string that is contained in therequest URL after the path?A - - - - None of the 40 - Which of the following code retrieves the Internet Protocol IP address of theclient that sent the request?A - - - - None of the 41 - Which of the following code retrieves the fully qualified name of the clientmaking this request?A - - - - None of the 42 - Which of the following code retrieves the login of the user making this request?A - - - - None of the 43 - Which of the following code retrieves the part of this request's URL from theprotocol name?A - - - - None of the 44 - Which of the following code retrieves session ID specified by the client?

9 A - - - - None of the 45 - Which of the following code checks whether this request was made using asecure channel, such as HTTPS?A - - - - None of the 46 - Which of the following code returns the port number on which this request wasreceived?A - - - - None of the 47 - Which of the following code encodes the specified URL for use in thesendRedirect method?A - - - - None of the 48 - Which of the following code encodes the specified URL by including the sessionID in it?A - - - - None of the 49 - Which of the following code indicates whether the named response header hasalready been set?A - - - - None of the 50 - Which of the following code indicates whether the response has beencommitted?A - - - - None of the SHEETANSWER SHEETQ uestion NumberAnswer Key1C2D3C4A5A6C7B8D9C10C11A12C13A14B15C1 6C17A18B19C20A21A22B23B24B25A26A27A28A29 C30C31C32B33B34C35C36C37C38C39C40A41A42A 43A44A45B46B47A48A49A50 AProcessing math: 100%


Related search queries