MCQOPTIONS
Saved Bookmarks
This section includes 218 Mcqs, each offering curated multiple-choice questions to sharpen your BBA in Computer Applications knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
To create an InputStream on a socket, say s, which of the following statement isnecessary? |
| A. | InputStream in = new InputStream(s); |
| B. | InputStream in = s.getInputStream(); |
| C. | InputStream in = s.obtainInputStream(); |
| D. | InputStream in = s.getStream(); |
| Answer» C. InputStream in = s.obtainInputStream(); | |
| 2. |
How is the dynamic interception of requests and responses to transform the informationdone? |
| A. | servlet container |
| B. | servlet config |
| C. | servlet context |
| D. | servlet filter |
| Answer» E. | |
| 3. |
Which of these is a protocol for breaking and sending packets to an address across anetwork? |
| A. | TCP/IP |
| B. | DNS |
| C. | Socket |
| D. | Proxy Server |
| Answer» B. DNS | |
| 4. |
The client requests a connection to a server using which of the following statement? |
| A. | Socket s = new Socket(ServerName, port); |
| B. | Socket s = serverSocket.accept(); |
| C. | Socket s = serverSocket.getSocket(); |
| D. | Socket s = new Socket(ServerName); |
| Answer» B. Socket s = serverSocket.accept(); | |
| 5. |
In RMI applications which program obtains a remote reference to one ormore remote objects on a server and then invokes methods on them? |
| A. | server |
| B. | client |
| C. | both a & b |
| D. | none of the above |
| Answer» C. both a & b | |
| 6. |
How many techniques are used in Session Tracking? |
| A. | 4 |
| B. | 3 |
| C. | 2 |
| D. | 5 |
| Answer» B. 3 | |
| 7. |
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 | |
| 8. |
Which method take a string not a URL? |
| A. | sendRedirect |
| B. | forward |
| C. | Both |
| D. | None |
| Answer» B. forward | |
| 9. |
Which spring module provides the capability of DI or IOC? |
| A. | Spring web |
| B. | Core container |
| C. | AOP |
| D. | Data access |
| Answer» C. AOP | |
| 10. |
For cross field validation or some sort of barrier to ensure state before you start aflow, we use. |
| A. | FacesContext |
| B. | FaceletContext |
| C. | FacesResolver |
| D. | All of the mentioned |
| Answer» B. FaceletContext | |
| 11. |
Which of the following step establishes a connection with a database? |
| A. | Import packages containing the JDBC classes needed for database programming. |
| B. | Register the JDBC driver, so that you can open a communications channel with the database. |
| C. | Open a connection using the DriverManager.getConnection () method. |
| D. | Execute a query using an object of type Statement. |
| Answer» D. Execute a query using an object of type Statement. | |
| 12. |
Which was the first most widely used programming interface for accessing relational databases and it offers the ability to connect all the databases on all the platforms.? |
| A. | JDBC API |
| B. | ODBC API |
| C. | Both A & B |
| D. | None of the above |
| Answer» C. Both A & B | |
| 13. |
Sessions is a part of the SessionTracking and it is for maintaining the client state at serverside. |
| A. | True |
| B. | False |
| C. | none |
| D. | all |
| Answer» B. False | |
| 14. |
Which of the following method call is valid to obtain the server's hostname by invokingan applet? |
| A. | getCodeBase().host() |
| B. | getCodeBase().getHost() |
| C. | getCodeBase().hostName() |
| D. | getCodeBase().getHostName() |
| Answer» C. getCodeBase().hostName() | |
| 15. |
The JDBC API is what allows access to a data source from a Java middle tier |
| A. | True |
| B. | False |
| C. | none |
| D. | all |
| Answer» B. False | |
| 16. |
Is Session a thread-safe object? |
| A. | True |
| B. | False |
| C. | none |
| D. | all |
| Answer» C. none | |
| 17. |
What is JDBC? |
| A. | JDBC is a java based protocol. |
| B. | JDBC is a standard Java API for database-independent connectivity between the Java programming language and a wide range of databases. |
| C. | JDBC is a specification to tell how to connect to a database. |
| D. | Joint Driver for Basic Connection |
| Answer» C. JDBC is a specification to tell how to connect to a database. | |
| 18. |
What is the reason that a java program cannot directly communicate with an ODBCdriver? |
| A. | ODBC written in C# language |
| B. | ODBC written in C language |
| C. | ODBC written in C++ language |
| D. | None of the above |
| Answer» C. ODBC written in C++ language | |
| 19. |
The SessionFactory is heavyweight object. |
| A. | False |
| B. | True |
| C. | none |
| D. | all |
| Answer» C. none | |
| 20. |
Which method in session tracking is used in a bit of information that is sent by a web server to a browser and which can later be read back from that browser? |
| A. | HttpSession |
| B. | URL rewriting |
| C. | Cookies |
| D. | Hidden form fields |
| Answer» D. Hidden form fields | |
| 21. |
Which of these method of DatagramPacket is used to obtain the byte array ofdata contained in a datagram? |
| A. | getdata() |
| B. | getbytes() |
| C. | getarray() |
| D. | recievebytes() |
| Answer» B. getbytes() | |
| 22. |
JDBC RowSet is the wrapper of ResultSet,It holds tabular data like ResultSet but it iseasy and flexible to use. |
| A. | True |
| B. | False |
| C. | none |
| D. | all |
| Answer» B. False | |
| 23. |
How does spring achieve DI or IOC? |
| A. | Service locator pattern |
| B. | Factory pattern |
| C. | Abstract factory pattern |
| D. | Singleton pattern |
| Answer» B. Factory pattern | |
| 24. |
Which of the following manages a list of database drivers in JDBC? |
| A. | DriverManager |
| B. | JDBC driver |
| C. | Connection |
| D. | Statement |
| Answer» B. JDBC driver | |
| 25. |
To connect to a server running on the same machine with the client, which of the following cannotbe used for the hostname? |
| A. | “localhost” |
| B. | "127.0.0.1" |
| C. | InetAddress.getLocalHost(), |
| D. | "127.0.0.0" |
| Answer» E. | |
| 26. |
Which JDBC drivers will run your program? |
| A. | The JDBC-ODBC bridge |
| B. | The JDBC driver manager |
| C. | The JDBC driver test suite |
| D. | None of the above |
| Answer» D. None of the above | |
| 27. |
JavaServer Pages often serve the same purpose as programs implemented using theCommon Gateway Interface (CGI) |
| A. | True |
| B. | False |
| C. | none |
| D. | all |
| Answer» B. False | |
| 28. |
Which of these class is necessary to implement datagrams?DNYANSAGAR ARTS AND COMMERCE COLLEGE, BALEWADI,PUNE - 45PROF . SUPRIYA MANE www.dacc.edu.in |
| A. | datagrampacket |
| B. | datagramsocket |
| C. | all of the mentioned |
| D. | none of the mentioned |
| Answer» D. none of the mentioned | |
| 29. |
Which models do the JDBC API support for the database access? |
| A. | Two-tier models |
| B. | Three-tier models |
| C. | Both A & B |
| D. | None of the above |
| Answer» D. None of the above | |
| 30. |
Which of the following are the valid scopes in JSP? |
| A. | request, page, session, application |
| B. | request, page, session, global |
| C. | response, page, session, application |
| D. | request, page, context, application |
| Answer» B. request, page, session, global | |
| 31. |
What type of scriptlet code is better-suited to being factored forward into aservlet? |
| A. | code that deals with logic that is common across requests. |
| B. | code that deals with logic that is vendor specific) |
| C. | code that deals with logic that relates to database access. |
| D. | code that deals with logic that relates to client scope. |
| Answer» B. code that deals with logic that is vendor specific) | |
| 32. |
What is the lifecycle of a servlet? |
| A. | Servlet class is loaded |
| B. | Servlet instance is created |
| C. | init,Service,destroy method is invoked |
| D. | All mentioned above |
| Answer» E. | |
| 33. |
Which of the following type of JDBC driver, uses database native protocol? |
| A. | JDBC-ODBC Bridge plus ODBC driver |
| B. | Native-API, partly Java driver |
| C. | JDBC-Net, pure Java driver |
| D. | Native-protocol, pure Java driver |
| Answer» E. | |
| 34. |
In the following statements identify the disadvantages of CGI? |
| A. | If number of clients increases, it takes more time for sending response |
| B. | For each request, it starts a process and Web server is limited to start processes |
| C. | It uses platform dependent language e.g. C, C++, perl |
| D. | All mentioned above |
| Answer» E. | |
| 35. |
Which of these method is called when http daemon is acting like a normal webserver? |
| A. | handle() |
| B. | handleget() |
| C. | handleget() |
| D. | handleget() |
| Answer» D. handleget() | |
| 36. |
Which of the following is not a valid type of ResultSet? |
| A. | ResultSet.TYPE_FORWARD_ONLY |
| B. | ResultSet.TYPE_SCROLL_INSENSITIVE |
| C. | ResultSet.TYPE_SCROLL_SENSITIVE |
| D. | ResultSet.TYPE_BACKWARD_ONLY |
| Answer» E. | |
| 37. |
Which of the following holds data retrieved from a database after you execute an SQLquery using Statement objects? |
| A. | ResultSet |
| B. | JDBC driver |
| C. | Connection |
| D. | Statement |
| Answer» B. JDBC driver | |
| 38. |
JDBC is a Java API that is used to connect and execute query to the database |
| A. | True |
| B. | False |
| C. | none |
| D. | all |
| Answer» B. False | |
| 39. |
What is the basic concept of Spring? |
| A. | Factory pattern |
| B. | Singleton pattern |
| C. | Dependency injection or Inversion of control |
| D. | Abstract factory pattern |
| Answer» D. Abstract factory pattern | |
| 40. |
What are beans in the concept of Spring or what are spring beans? |
| A. | Controller classes |
| B. | Service classes |
| C. | Repository |
| D. | Any class that is managed by the container. |
| Answer» E. | |
| 41. |
The ASP and JSP technologies are quite similar in the way they support the creation of Dynamic pages, using HTML templates, scripting code and components for business logic. |
| A. | True |
| B. | False |
| C. | none |
| D. | all |
| Answer» B. False | |
| 42. |
Which of the following type of JDBC driver, is also called Type 2 JDBC driver? |
| A. | JDBC-ODBC Bridge plus ODBC driver |
| B. | Native-API, partly Java driver |
| C. | JDBC-Net, pure Java driver |
| D. | Native-protocol, pure Java driver |
| Answer» C. JDBC-Net, pure Java driver | |
| 43. |
Which http method send by browser that asks the server to get the page only? |
| A. | get |
| B. | option |
| C. | put |
| D. | post |
| Answer» B. option | |
| 44. |
When the message “No Suitable Driver” occurs? |
| A. | when the driver is not registered by class.forname() method |
| B. | when the user name, password and the database does not match |
| C. | when the jdbc database url passed is not constructed properly |
| D. | when the type 4 driver is used |
| Answer» D. when the type 4 driver is used | |
| 45. |
Which of the following methods finds the maximum number of connectionsthat a specific driver can obtain? |
| A. | database.getmaxconnections |
| B. | connection.getmaxconnections |
| C. | databasemetadata)getmaxconnections |
| D. | resultsetmetadata)getmaxconnections |
| Answer» D. resultsetmetadata)getmaxconnections | |
| 46. |
How many Result sets available with the JDBC 2.0 core API? |
| A. | 2 |
| B. | 3 |
| C. | 4 |
| D. | 5 |
| Answer» C. 4 | |
| 47. |
All raw data types (including binary documents or images) should be read anduploaded to the database as an array of |
| A. | byte |
| B. | int |
| C. | boolean |
| D. | char |
| Answer» B. int | |
| 48. |
Which method is used to establish the connection with the specified url in a Driver Manager class? |
| A. | public static void registerDriver(Driver driver) |
| B. | public static void deregisterDriver(Driver driver) |
| C. | public static Connection getConnection(String url) |
| D. | public static Connection getConnection(String url,String userName,String password) |
| Answer» D. public static Connection getConnection(String url,String userName,String password) | |
| 49. |
Which method is used to specify before any lines that uses the PintWriter? |
| A. | setPageType() |
| B. | setContextType() |
| C. | setContentType() |
| D. | setResponseType() |
| Answer» D. setResponseType() | |
| 50. |
How many trAnsweraction isolation levels are defined in javA)sql.Connectioninterface? |
| A. | 4 |
| B. | 3 |
| C. | 5 |
| D. | 2 |
| Answer» D. 2 | |