MCQOPTIONS
Saved Bookmarks
This section includes 1671 Mcqs, each offering curated multiple-choice questions to sharpen your Technical Programming knowledge and support exam preparation. Choose a topic below to get started.
| 501. |
Which of the following action variable is used to include a file in JSP? |
| A. | jsp:setProperty |
| B. | jsp:getProperty |
| C. | jsp:include |
| D. | jsp:plugin |
| Answer» D. jsp:plugin | |
| 502. |
Which one of the following is correct for directive in JSP? |
| A. | <%@directive%> |
| B. | <%!directive%> |
| C. | <%directive%> |
| D. | <%=directive%> |
| Answer» B. <%!directive%> | |
| 503. |
Which is mandatory in tag? |
| A. | id, class |
| B. | id, type |
| C. | type, property |
| D. | type,id |
| Answer» B. id, type | |
| 504. |
Which is not a directive? |
| A. | include |
| B. | page |
| C. | export |
| D. | useBean |
| Answer» D. useBean | |
| 505. |
“request” is instance of which one of the following classes? |
| A. | Request |
| B. | HttpRequest |
| C. | HttpServletRequest |
| D. | ServletRequest |
| Answer» D. ServletRequest | |
| 506. |
Which one is correct order of phases in JSP life cycle? |
| A. | Initialization, Cleanup, Compilation, Execution |
| B. | Initialization, Compilation, Cleanup, Execution |
| C. | Compilation, Initialization, Execution, Cleanup |
| D. | Cleanup, Compilation, Initialization, Execution |
| Answer» D. Cleanup, Compilation, Initialization, Execution | |
| 507. |
Which option is true about session scope? |
| A. | Objects are accessible only from the page in which they are created |
| B. | Objects are accessible only from the pages which are in same session |
| C. | Objects are accessible only from the pages which are processing the same request |
| D. | Objects are accessible only from the pages which reside in same application |
| Answer» C. Objects are accessible only from the pages which are processing the same request | |
| 508. |
_jspService() method of HttpJspPage class should not be overridden. |
| A. | True |
| B. | false false |
| Answer» B. false false | |
| 509. |
Application is instance of which class? |
| A. | javax.servlet.Application |
| B. | javax.servlet.HttpContext |
| C. | javax.servlet.Context |
| D. | javax.servlet.ServletContext |
| Answer» E. | |
| 510. |
Which page directive should be used in JSP to generate a PDF page? |
| A. | content Type |
| B. | generate Pdf |
| C. | type PDF |
| D. | content PDF |
| Answer» B. generate Pdf | |
| 511. |
Which object is used by spring for authentication? |
| A. | Context Holder |
| B. | Security Holder |
| C. | Anonymous Holder |
| D. | Security Context Holder |
| Answer» E. | |
| 512. |
Which method creates unique fields in the HTML which are not shown to the user ? |
| A. | User authentication |
| B. | URL writing |
| C. | HTML Hidden field |
| D. | HTML invisible field |
| Answer» D. HTML invisible field | |
| 513. |
How can we invalidate a session? |
| A. | session.discontinue() |
| B. | session.invalidate() |
| C. | session.disconnect() |
| D. | session.falsify() |
| Answer» C. session.disconnect() | |
| 514. |
What is the maximum size of cookie ? |
| A. | 4 KB |
| B. | 4 MB |
| C. | 4 bytes |
| D. | 40 KB |
| Answer» B. 4 MB | |
| 515. |
SessionIDs are stored in cookies. |
| A. | True |
| B. | False |
| Answer» B. False | |
| 516. |
Which of the following is not true about session? |
| A. | All users connect to the same session |
| B. | All users have same session variable |
| C. | Default timeout value for session variable is 20 minutes |
| D. | New session cannot be created for a new user |
| Answer» D. New session cannot be created for a new user | |
| 517. |
Which of the following leads to high network traffic? |
| A. | URL rewriting |
| B. | Hidden form fields |
| C. | SSL sessions |
| D. | Cookies |
| Answer» B. Hidden form fields | |
| 518. |
Which of the following is stored at client side? |
| A. | URL rewriting |
| B. | Hidden form fields |
| C. | SSL sessions |
| D. | Cookies |
| Answer» E. | |
| 519. |
Which of the below is not a session tracking method? |
| A. | URL rewriting |
| B. | History |
| C. | Cookies |
| D. | SSL sessions |
| Answer» C. Cookies | |
| 520. |
Which of the following is used for session migration? |
| A. | Persisting the session in database |
| B. | URL rewriting |
| C. | Create new database connection |
| D. | Kill session from multiple sessions |
| Answer» B. URL rewriting | |
| 521. |
Which are the session tracking techniques? i. URL rewriting ii. Using session object iii.Using response object iv. Using hidden fields v. Using cookies vi. Using servlet object |
| A. | i, ii, iii, vi |
| B. | i, ii, iv, v |
| C. | i, vi, iii, v |
| D. | i, ii, iii, v |
| Answer» C. i, vi, iii, v | |
| 522. |
How is dynamic interception of requests and responses to transform the information done? |
| A. | servlet container |
| B. | servlet config |
| C. | servlet context |
| D. | servlet filter |
| Answer» E. | |
| 523. |
Which of the following is true about servlets? |
| A. | Servlets execute within the address space of web server |
| B. | Servlets are platform-independent because they are written in java |
| C. | Servlets can use the full functionality of the Java class libraries |
| D. | Servlets execute within the address space of web server, platform independent and uses the functionality of java class libraries |
| Answer» E. | |
| 524. |
When destroy() method of filter is called? |
| A. | The destroy() method is called only once at the end of the life cycle of a filter |
| B. | The destroy() method is called after the filter has executed doFilter method |
| C. | Both of the mentioned |
| D. | The destroyer() method is called after the filter has executed |
| Answer» B. The destroy() method is called after the filter has executed doFilter method | |
| 525. |
Which of the following code retrieves the body of the request as binary data? |
| A. | DataInputStream data = new InputStream() |
| B. | DataInputStream data = response.getInputStream() |
| C. | DataInputStream data = request.getInputStream() |
| D. | DataInputStream data = request.fetchInputStream() |
| Answer» D. DataInputStream data = request.fetchInputStream() | |
| 526. |
Which method is used to get three-letter abbreviation for locale’s country in servlets? |
| A. | Request.getISO3Country() |
| B. | Locale.getISO3Country() |
| C. | Response.getISO3Country() |
| D. | Local.retrieveISO3Country() |
| Answer» B. Locale.getISO3Country() | |
| 527. |
Which of the following code is used to get an attribute in a HTTP Session object in servlets? |
| A. | session.getAttribute(String name) |
| B. | session.alterAttribute(String name) |
| C. | session.updateAttribute(String name) |
| D. | session.setAttribute(String name) |
| Answer» B. session.alterAttribute(String name) | |
| 528. |
What is the difference between servlets and applets? i.Servlets execute on Server; Applets execute on browser ii.Servlets have no GUI; Applet has GUI iii.Servlets creates static web pages; Applets creates dynamic web pages iv.Servlets can handle only a single request; Applet can handle multiple requests |
| A. | i,ii,iii are correct |
| B. | i,ii are correct |
| C. | i,iii are correct |
| D. | i,ii,iii,iv are correct |
| Answer» C. i,iii are correct | |
| 529. |
Can servlet class declare constructor with ServletConfig object as a argument? |
| A. | True |
| B. | False |
| Answer» C. | |
| 530. |
How constructor can be used for a servlet? |
| A. | Initialization |
| B. | Constructor function |
| C. | Initialization and Constructor function |
| D. | Setup() method |
| Answer» D. Setup() method | |
| 531. |
What is the java method for ping? |
| A. | hostReachable() |
| B. | ping() |
| C. | isReachable() |
| D. | portBusy() |
| Answer» D. portBusy() | |
| 532. |
What happens if IP Address of host cannot be determined? |
| A. | The system exit with no message |
| B. | UnknownHostException is thrown |
| C. | IOException is thrown |
| D. | Temporary IP Address is assigned |
| Answer» C. IOException is thrown | |
| 533. |
What does local IP address start with? |
| A. | 10.X.X.X |
| B. | 172.X.X.X |
| C. | 192.168.X.X |
| D. | 10.X.X.X, 172.X.X.X, or 192.168.X.X |
| Answer» E. | |
| 534. |
Which class represents an Internet Protocol address? |
| A. | InetAddress |
| B. | Address |
| C. | IP Address |
| D. | TCP Address |
| Answer» B. Address | |
| 535. |
Which of the below are common network protocols? |
| A. | TCP |
| B. | UDP |
| C. | TCP and UDP |
| D. | CNP |
| Answer» D. CNP | |
| 536. |
What does bind() method of ServerSocket offer? |
| A. | binds the serversocket to a specific address (IP Address and port) |
| B. | binds the server and client browser |
| C. | binds the server socket to the JVM |
| D. | binds the port to the JVM |
| Answer» B. binds the server and client browser | |
| 537. |
What happens if ServerSocket is not able to listen on the specified port? |
| A. | The system exits gracefully with appropriate message |
| B. | The system will wait till port is free |
| C. | IOException is thrown when opening the socket |
| D. | PortOccupiedException is thrown |
| Answer» D. PortOccupiedException is thrown | |
| 538. |
Which class provides system independent server side implementation? |
| A. | Socket |
| B. | ServerSocket |
| C. | Server |
| D. | ServerReader |
| Answer» C. Server | |
| 539. |
In CGI, process starts with each request and will initiate OS level process. |
| A. | True |
| B. | False |
| Answer» B. False | |
| 540. |
How does applet and servlet communicate? |
| A. | HTTP |
| B. | HTTPS |
| C. | FTP |
| D. | HTTP Tunneling |
| Answer» E. | |
| 541. |
What is the storage capacity of single cookie? |
| A. | 2048 MB |
| B. | 2048 bytes |
| C. | 4095 bytes |
| D. | 4095 MB |
| Answer» D. 4095 MB | |
| 542. |
What is the full form of MIME in Java? |
| A. | Multipurpose Internet Messaging Extension |
| B. | Multipurpose Internet Mail Extension |
| C. | Multipurpose Internet Media Extension |
| D. | Multipurpose Internet Mass Extension |
| Answer» C. Multipurpose Internet Media Extension | |
| 543. |
What type of protocol is HTTP? |
| A. | stateless |
| B. | stateful |
| C. | transfer protocol |
| D. | information protocol |
| Answer» B. stateful | |
| 544. |
Which of the below can be used to debug front end of a web application ? |
| A. | Junit |
| B. | Fitnesse |
| C. | Firebug |
| D. | Mockito |
| Answer» D. Mockito | |
| 545. |
Which of the below is not a javascript framework for UI? |
| A. | Vaadin |
| B. | AngularJS |
| C. | KendoUI |
| D. | Springcore |
| Answer» E. | |
| 546. |
How can we take input text from user in HTML page? |
| A. | input tag |
| B. | inoutBufferedReader tag |
| C. | meta tag |
| D. | scanner tag |
| Answer» B. inoutBufferedReader tag | |
| 547. |
How can we connect to database in a web application? |
| A. | oracle sql developer |
| B. | toad |
| C. | JDBC template |
| D. | mysql |
| Answer» D. mysql | |
| 548. |
How are java web applications packaged? |
| A. | jar |
| B. | war |
| C. | zip |
| D. | both jar and war |
| Answer» E. | |
| 549. |
Which component can be used for sending messages from one application to another? |
| A. | server |
| B. | client |
| C. | mq |
| D. | webapp |
| Answer» D. webapp | |
| 550. |
Servlet are used to program which component in a web application? |
| A. | client |
| B. | server |
| C. | tomcat |
| D. | applet |
| Answer» C. tomcat | |