![Mcqmate logo](https://mcqmate.com/images/logos/logo-black.png)
![Mcqmate logo](https://mcqmate.com/images/logos/logo-white.png)
McqMate
Chapters
1. |
Which of the following contains both date and time? |
A. | java.io.date |
B. | java.sql.date |
C. | java.util.date |
D. | java.util.datetime |
Answer» D. java.util.datetime |
2. |
Which of the following is advantage of using JDBC connection pool? |
A. | slow performance |
B. | using more memory |
C. | using less memory |
D. | better performance |
Answer» D. better performance |
3. |
Which of the following is advantage of using PreparedStatement in Java? |
A. | slow performance |
B. | encourages sql injection |
C. | prevents sql injection |
D. | more memory usage |
Answer» C. prevents sql injection |
4. |
Which one of the following contains date information? |
A. | java.sql.timestamp |
B. | java.sql.time |
C. | java.io.time |
D. | java.io.timestamp |
Answer» A. java.sql.timestamp |
5. |
What does setAutoCommit(false) do? |
A. | commits transweraction after each query |
B. | explicitly commits transweraction |
C. | does not commit transweraction automatically after each query |
D. | never commits transweraction |
Answer» C. does not commit transweraction automatically after each query |
6. |
Which of the following is used to call stored procedure? |
A. | statement |
B. | preparedstatement |
C. | callablestatment |
D. | calledstatement |
Answer» C. callablestatment |
7. |
Which of the following is method of JDBC batch process? |
A. | setbatch() |
B. | deletebatch() |
C. | removebatch() |
D. | addbatch() |
Answer» D. addbatch() |
8. |
Which of the following is used to rollback a JDBC trAnsweraction? |
A. | rollback() |
B. | rollforward() |
C. | deletetransweraction() |
D. | removetransweraction() |
Answer» A. rollback() |
9. |
Which driver uses ODBC driver to connect to the database? |
A. | jdbc-odbc bridge driver |
B. | native - api driver |
C. | network protocol driver |
D. | thin driver |
Answer» A. jdbc-odbc bridge driver |
10. |
How many JDBC product components does the Java software provides? |
A. | 3 |
B. | 2 |
C. | 4 |
D. | 5 |
Answer» A. 3 |
11. |
How many types of JDBC drivers are available? |
A. | 3 |
B. | 4 |
C. | 2 |
D. | 5 |
Answer» B. 4 |
12. |
Which result set generally does not show changes to the underlying database
|
A. | type_forward_only |
B. | type_scroll_insensitive |
C. | type_scroll_sensitive |
D. | all mentioned above |
Answer» B. type_scroll_insensitive |
13. |
Which method is used for an SQL statement that is executed frequently? |
A. | prepare statement |
B. | prepare call |
C. | create statement |
D. | none of the above |
Answer» A. prepare statement |
14. |
What is used to execute parameterized query? |
A. | statement interface |
B. | preparedstatement interface |
C. | resultset interface |
D. | none of the above |
Answer» B. preparedstatement interface |
15. |
Which JDBC product components does the Java software provide? |
A. | the jdbc driver manager |
B. | the jdbc driver test suite |
C. | the jdbc-odbc bridge |
D. | all mentioned above |
Answer» D. all mentioned above |
16. |
JDBC stands for? |
A. | java database connectivity |
B. | java database concept |
C. | java database communications |
D. | none of the above |
Answer» A. java database connectivity |
17. |
Which of the following allows non repeatable read in JDBC Connection? |
A. | transweraction_read_uncommitted |
B. | transweraction_read_committed |
C. | transweraction_serializable |
D. | transweraction_repeatable_read |
Answer» D. transweraction_repeatable_read |
18. |
Which of the following statements is false as far as different type of statements is concern in JDBC? |
A. | regular statement |
B. | prepared statement |
C. | callable statement |
D. | interim statement |
Answer» D. interim statement |
19. |
Which of the following methods are needed for loading a database driver in JDBC? |
A. | registerdriver() method |
B. | class.forname() |
C. | both a and b |
D. | getconnection() |
Answer» C. both a and b |
20. |
Which of the following is false as far as type 4 driver is concern? |
A. | type 4 driver is “native protocol, pure java” driver |
B. | type 4 drivers are 100% java compatible |
C. | type 4 drivers uses socket class to connect to the database |
D. | type 4 drivers can not be used with netscape |
Answer» D. type 4 drivers can not be used with netscape |
21. |
Which driver is efficient and always preferable for using JDBC applications? |
A. | type – 4 |
B. | type – 1 |
C. | type – 3 |
D. | type – 2 |
Answer» A. type – 4 |
22. |
JDBC facilitates to store the java objects by using which of the methods of
|
A. | 1, 2 |
B. | 1,2,3 |
C. | 1,3 |
D. | 2,3 |
Answer» B. 1,2,3 |
23. |
The JDBC-ODBC bridge is |
A. | three tiered |
B. | multithreaded |
C. | best for any platform |
D. | all of the above |
Answer» B. multithreaded |
24. |
All raw data types (including binary documents or images) should be read and uploaded to the database as an array of |
A. | byte |
B. | int |
C. | boolean |
D. | char |
Answer» A. byte |
25. |
The class javA)sql.Timestamp has its super class as |
A. | java)sql.time |
B. | java)util.date |
C. | java)util.time |
D. | none of the above |
Answer» B. java)util.date |
26. |
BLOB, CLOB, ARRAY and REF type columns can be updated in |
A. | jdbc 1.0 |
B. | jdbc 4.0 |
C. | jdbc 2.0 |
D. | jdbc 3.0 |
Answer» D. jdbc 3.0 |
27. |
Which of the following methods finds the maximum number of connections that a specific driver can obtain? |
A. | database.getmaxconnections |
B. | connection.getmaxconnections |
C. | databasemetadata)getmaxconnections |
D. | resultsetmetadata)getmaxconnections |
Answer» C. databasemetadata)getmaxconnections |
28. |
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» C. when the jdbc database url passed is not constructed properly |
29. |
Which driver is called as thin-driver in JDBC? |
A. | type-4 driver |
B. | type-1 driver |
C. | type-3 driver |
D. | type-2 driver |
Answer» A. type-4 driver |
30. |
How many trAnsweraction isolation levels are defined in javA)sql.Connection interface? |
A. | 4 |
B. | 3 |
C. | 5 |
D. | 2 |
Answer» C. 5 |
31. |
Which method is used to perform DML statements in JDBC? |
A. | execute() |
B. | executequery() |
C. | executeupdate() |
D. | executeresult() |
Answer» C. executeupdate() |
32. |
What is the disadvantage of Type-4 Native-Protocol Driver? |
A. | at client side, a separate driver is needed for each database. |
B. | type-4 driver is entirely written in java |
C. | the driver converts jdbc calls into vendor-specific database protocol |
D. | it does not support to read mysql data) |
Answer» A. at client side, a separate driver is needed for each database. |
33. |
TCP,FTP,Telnet,SMTP are example of? |
A. | socket |
B. | ip address |
C. | protocol |
D. | mac address |
Answer» C. protocol |
34. |
In Inetaddress class which method returns the host name of IP address? |
A. | public string gethostname() |
B. | public string gethostaddress() |
C. | public string inetaddress getlocalhost() |
D. | none |
Answer» A. public string gethostname() |
35. |
Show some networking terminology given below? |
A. | all |
B. | ip address |
C. | protocol |
D. | mac address |
Answer» A. all |
36. |
Which classes are used for connection less socket programming? |
A. | datagram socket |
B. | datagram packet |
C. | both a and b |
D. | none |
Answer» C. both a and b |
37. |
how many ports TCP/IP are reserved for specific protocol? |
A. | 10 |
B. | 1024 |
C. | 2048 |
D. | 512 |
Answer» B. 1024 |
38. |
how many bits are in a single IP address? |
A. | 8 |
B. | 16 |
C. | 32 |
D. | 64 |
Answer» C. 32 |
39. |
Which of these class is used to encapsulate IP address and DNS? |
A. | datagram packet |
B. | url |
C. | inetaddress |
D. | contenthandler |
Answer» C. inetaddress |
40. |
Which of these is return type of getAddress method of DatagramPacket class? |
A. | findaddress() |
B. | getaddress() |
C. | address() |
D. | whois() |
Answer» B. getaddress() |
41. |
Which of these method of DatagramPacket is used to find port number? |
A. | port() |
B. | getport() |
C. | findport() |
D. | receivedport() |
Answer» A. port() |
42. |
Which of these class is necessary to implement datagrams? |
A. | datagrampacket |
B. | datagramsocket |
C. | all of the mentioned |
D. | none of the mentioned |
Answer» C. all of the mentioned |
43. |
Which of these method of DatagramPacket is used to find the port number? |
A. | port() |
B. | getport() |
C. | findport() |
D. | recieveport() |
Answer» A. port() |
44. |
Which of these method of DatagramPacket is used to obtain the byte array of data contained in a datagram? |
A. | getdata() |
B. | getbytes() |
C. | getarray() |
D. | recievebytes() |
Answer» A. getdata() |
45. |
Which of these method of DatagramPacket is used to find the length of byte array? |
A. | getnumber() |
B. | length() |
C. | length() |
D. | getlength() |
Answer» D. getlength() |
46. |
Which of these method is used to start a server thread? |
A. | run() |
B. | start() |
C. | runthread() |
D. | startthread() |
Answer» A. run() |
47. |
Which of these method is called when http daemon is acting like a normal web server? |
A. | handle() |
B. | handleget() |
C. | handleget() |
D. | handleget() |
Answer» C. handleget() |
48. |
Which of these methods of httpd class is used to read data from the stream? |
A. | getdta() |
B. | getresponse() |
C. | getstream() |
D. | getrawrequest() |
Answer» D. getrawrequest() |
49. |
Which of these method of httpd class is used to get report on each hit to HTTP server? |
A. | log() |
B. | logentry() |
C. | loghttpd() |
D. | logresponse() |
Answer» B. logentry() |
50. |
Which of these method is used to find a URL from the cache of httpd? |
A. | findfromcache() |
B. | findfromcache() |
C. | servefromcache() |
D. | getfromcache() |
Answer» C. servefromcache() |
51. |
Which of these variables stores the number of hits that are successfully served out of cache? |
A. | hits |
B. | hitstocache |
C. | hits_to_cache |
D. | hits.to.cache |
Answer» D. hits.to.cache |
52. |
Which of these method of httpd class is used to write UrlCacheEntry object into local disk? |
A. | writediskcache() |
B. | writetodisk() |
C. | writecache() |
D. | writediskentry() |
Answer» A. writediskcache() |
53. |
Which of these is an instance variable of class httpd? |
A. | port |
B. | cache |
C. | log |
D. | all of the mentioned |
Answer» D. all of the mentioned |
54. |
Which of these is an instance variable of httpd that is a Hashtable? |
A. | port |
B. | cache |
C. | log |
D. | stopflag |
Answer» C. log |
55. |
Which of these exception is thrown by URL class’s constructors? |
A. | urlnotfound |
B. | urlsourcenotfound |
C. | malformedurlexception |
D. | urlnotfoundexception |
Answer» C. malformedurlexception |
56. |
Which of these methods is used to know host of an URL? |
A. | host() |
B. | gethost() |
C. | gethost() |
D. | gethost() |
Answer» B. gethost() |
57. |
Which of these methods is used to know the full URL of an URL object? |
A. | fullhost() |
B. | gethost() |
C. | externalform() |
D. | toexternalform() |
Answer» D. toexternalform() |
58. |
Which of these class is used to access actual bits or content information of a URL? |
A. | url |
B. | urldecoder |
C. | urlconnection |
D. | all of the mentioned |
Answer» D. all of the mentioned |
59. |
Which object of HttpSession can be used to view and manipulate information about a session? |
A. | session identifier |
B. | creation time |
C. | last accessed time |
D. | all mentioned above |
Answer» D. all mentioned above |
60. |
Which of these ways used to communicate from an applet to servlet? |
A. | rmi communication |
B. | http communication |
C. | socket communication |
D. | all mentioned above |
Answer» D. all mentioned above |
61. |
Which methods are used to bind the objects on HttpSession instance andget the objects? |
A. | setattribute |
B. | getattribute |
C. | both a & b |
D. | none of the above |
Answer» C. both a & b |
62. |
Which type of ServletEngine is a server that includes built-in support for servlets? |
A. | add-on servletengine |
B. | embedded servletengine |
C. | standalone servletengine |
D. | none of the above |
Answer» C. standalone servletengine |
63. |
What type of servlets use these methods doGet(), doPost(),doHead, doDelete(), doTrace()? |
A. | genereic servlets |
B. | httpservlets |
C. | all of the above |
D. | none of the above |
Answer» B. httpservlets |
64. |
Which cookie it is valid for single session only and it is removed each time when the user closes the browser? |
A. | persistent cookie |
B. | non-persistent cookie |
C. | all the above |
D. | none of the above |
Answer» B. non-persistent cookie |
65. |
Which action tags are used in JSP for developing web application with Java Bean? |
A. | jsp:usebean |
B. | jsp:setproperty |
C. | jsp:getproperty |
D. | both b & c |
Answer» D. both b & c |
66. |
Which technology do we mix our business logic with the presentation logic? |
A. | servlet |
B. | jsp |
C. | both a & b |
D. | none of the above |
Answer» A. servlet |
67. |
Which tag is used to execute java source code in JSP? |
A. | declaration tag |
B. | scriptlet tag |
C. | expression tag |
D. | none of the above |
Answer» B. scriptlet tag |
68. |
Which JSP Action tags is used to include the content of another resource,it May be jsp, html or servlet? |
A. | jsp:include |
B. | jsp:forward |
C. | jsp:plugin |
D. | jsp:papam |
Answer» A. jsp:include |
69. |
In JSP how many ways are there to perform exception handling? |
A. | 3 |
B. | 2 |
C. | 4 |
D. | 5 |
Answer» B. 2 |
70. |
In JSP page directive which attribute defines theMIME(Multipurpose Internet Mail Extension) type of the HTTP response? |
A. | import |
B. | content type |
C. | extends |
D. | info |
Answer» B. content type |
71. |
A JSP page consists of which tags? |
A. | html tags |
B. | jsp tags |
C. | both a & b |
D. | none of the above |
Answer» C. both a & b |
72. |
What alternatives exist to embedding Java code directly within the HTML markup of your JSP page? |
A. | moving the code into your session manager. |
B. | moving the code into scriptlets. |
C. | moving the code into javabeans and servlets. |
D. | moving the code into a transaction manager. |
Answer» C. moving the code into javabeans and servlets. |
73. |
What type of scriptlet code is better-suited to being factored forward into a servlet? |
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» A. code that deals with logic that is common across requests. |
74. |
URL encoding is the method of replacing all the spaces and other extra characters into their corresponding _______ Characters? |
A. | hex |
B. | binary |
C. | octal |
D. | decimal |
Answer» A. hex |
75. |
Which of the scripting of JSP not putting content into service method of the converted servlet? |
A. | declarations |
B. | scriptlets |
C. | expressions |
D. | none of the above |
Answer» A. declarations |
76. |
What requires less resources? |
A. | thread |
B. | process |
C. | thread and process |
D. | neither thread nor process |
Answer» A. thread |
77. |
What does not prevent JVM from terminating? |
A. | process |
B. | daemon thread |
C. | user thread |
D. | jvm thread |
Answer» B. daemon thread |
78. |
What decides thread priority? |
A. | process |
B. | process scheduler |
C. | thread |
D. | thread scheduler |
Answer» D. thread scheduler |
79. |
What should not be done to avoid deadlock? |
A. | avoid using multiple threads |
B. | avoid hold several locks at once |
C. | execute foreign code while holding a lock |
D. | use interruptible locks |
Answer» C. execute foreign code while holding a lock |
80. |
What is true about threading? |
A. | run() method calls start() method and runs the code |
B. | run() method creates new thread |
C. | run() method can be called directly without start() method being called |
D. | start() method creates new thread and calls code written in run() method |
Answer» D. start() method creates new thread and calls code written in run() method |
81. |
Which of the following is a correct constructor for thread? |
A. | thread(runnable a, string str) |
B. | thread(int priority) |
C. | thread(runnable a, int priority) |
D. | thread(runnable a, threadgroup t) |
Answer» A. thread(runnable a, string str) |
82. |
Which of the following will ensure the thread will be in running state? |
A. | yield() |
B. | notify() |
C. | wait() |
D. | thread.killthread() |
Answer» C. wait() |
83. |
Which of these are types of multitasking? |
A. | process based |
B. | thread based |
C. | process and thread based |
D. | none of the mentioned |
Answer» C. process and thread based |
84. |
What will happen if two thread of the same priority are called to be processed simultaneously? |
A. | anyone will be executed first lexographically |
B. | both of them will be executed simultaneously |
C. | none of them will be executed |
D. | it is dependent on the operating system |
Answer» D. it is dependent on the operating system |
85. |
In a RMI Client Program, what are the exceptions which might have to handled? |
A. | remoteexception |
B. | notboundexception |
C. | malformedurlexception |
D. | all mentioned above |
Answer» D. all mentioned above |
86. |
Which is a one-way communication only between the client and the server and it
|
A. | tcp/ip |
B. | udp |
C. | both a & b |
D. | none of the above |
Answer» B. udp |
87. |
An RMI Server is responsible for, |
A. | creating an instance of the remote object |
B. | exporting the remote object |
C. | binding the instance of the remote object to the rmi registry |
D. | all mentioned above |
Answer» D. all mentioned above |
88. |
In RMI Distributed object applications need to do? |
A. | locate remote objects |
B. | communicate with remote objects |
C. | load class definitions for objects that are passed around |
D. | all mentioned above |
Answer» D. all mentioned above |
89. |
In RMI applications which program obtains a remote reference to one or more 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» B. client |
90. |
Which package is used for Remote Method Invocation (RMI)? |
A. | java.lang.rmi |
B. | java.lang.reflect |
C. | java.applet |
D. | java.rmi |
Answer» D. java.rmi |
91. |
Java supports RMI, RMI Stands for? |
A. | random method invocation |
B. | remote memory interface |
C. | remote method invocation |
D. | random method invocation |
Answer» C. remote method invocation |
92. |
Which is built on the top of socket programming? |
A. | ejb |
B. | rmi |
C. | both a & b |
D. | none of the above |
Answer» B. rmi |
Done Reading?