350+ Advance Java Programming MCQ's
350+ Advance Java Programming MCQ's
350+ Advance Java Programming MCQ's
A. java.io
B. java.util
C. java.net
D. javax.swing
Answer» C. java.net
discuss
A. http
B. gtu.ac.in
C. //mcqmate.com:80/course.php
D. 8080
Answer» A. http
discuss
A. TCP
B. TCP/IP
C. UDP
D. HTTP
Answer» C. UDP
discuss
Which of the following statement is NOT true?
4.
C. File Transfer Protocol (FTP) is a standard Internet protocol for transmitting files between computers on the Internet
discuss
A. With stream sockets there is no need to establish any connection and data flows between the processes are as conti
B. Stream sockets are said to provide a connection-less service and UDP protocol is used
C. Datagram sockets are said to provide a connection-oriented service and TCP protocol is used
D. With datagram sockets there is no need to establish any connection and data flows between the processes are as pa
Answer» D. With datagram sockets there is no need to establish any connection and data flows between the processes ar
discuss
6. Which of the following method call is valid to obtain the server's hostname by invoking an applet?
A. getCodeBase().host()
B. getCodeBase().getHost()
C. getCodeBase().hostName()
D. getCodeBase().getHostName()
Answer» B. getCodeBase().getHost()
discuss
7. The server listens for a connection request from a client using which of the following statement?
B. Socket s = serverSocket.accept()
C. Socket s = serverSocket.getSocket()
discuss
The client requests a connection to a server using which of the following statement?
8.
B. Socket s = serverSocket.accept();
C. Socket s = serverSocket.getSocket();
discuss
9. To connect to a server running on the same machine with the client, which of the following cannotbe used for the
A. “localhost”
B. "127.0.0.1"
C. InetAddress.getLocalHost(),
D. "127.0.0.0"
Answer» D. "127.0.0.0"
discuss
In the socket programming, for an IP address, which can be used to find the host name and IP address of a client/
10.
discuss
11. To create an InputStream on a socket, say s, which of the following statement is necessary?
B. InputStream in = s.getInputStream();
C. InputStream in = s.obtainInputStream();
D. InputStream in = s.getStream();
discuss
12. Which of the following protocols is/are for splitting and sending packets to an address across a network?
A. TCP/IP
B. FTP
C. SMTP
D. UDP
Answer» A. TCP/IP
discuss
13. Which of these is a protocol for breaking and sending packets to an address across a network?
A. TCP/IP
B. DNS
13. Which of these is a protocol for breaking and sending packets to an address across a network?
C. Socket
D. Proxy Server
Answer» A. TCP/IP
discuss
A. DatagramPacket
B. URL
C. InetAddress
D. ContentHandler
Answer» C. InetAddress
discuss
Which of the following type of JDBC driver, is also called Type 2 JDBC driver?
15.
discuss
16. Which of the following type of JDBC driver, is also called Type 1 JDBC driver?
discuss
17. Which of the following holds data retrieved from a database after you execute an SQL query using Statement obj
A. ResultSet
B. JDBC driver
C. Connection
D. Statement
Answer» A. ResultSet
discuss
A. ResultSet.TYPE_FORWARD_ONLY
B. ResultSet.TYPE_SCROLL_INSENSITIVE
C. ResultSet.TYPE_SCROLL_SENSITIVE
D. ResultSet.TYPE_BACKWARD_ONLY
Answer» D. ResultSet.TYPE_BACKWARD_ONLY
discuss
Which of the following type of JDBC driver, uses database native protocol?
19.
B. JDBC is a standard Java API for database-independent connectivity between the Java programming language and a w
Answer» B. JDBC is a standard Java API for database-independent connectivity between the Java programming language a
discuss
A. DriverManager
B. JDBC driver
C. Connection
D. Statement
Answer» A. DriverManager
discuss
22. Which of the following type of JDBC driver should be used if your Java application is accessing multiple types of d
A. Type 1
B. Type 2
C. Type 3
D. Type 4
Answer» C. Type 3
discuss
discuss
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.
discuss
B. You use it to access relational databases without embedding a dependency on a specific database type in your code
discuss
How many Result sets available with the JDBC 2.0 core API?
26.
A. 2
B. 3
C. 4
How many Result sets available with the JDBC 2.0 core API?
26.
D. 5
Answer» B. 3
discuss
27. Which method is used to establish the connection with the specified url in a Driver Manager class?
discuss
28. Which driver Network connection is indirect that a JDBC client makes to a middleware process that acts as a bridg
A. JDBC-Net
B. JDBC-ODBC bridge
Answer» A. JDBC-Net
discuss
29. JDBC RowSet is the wrapper of ResultSet,It holds tabular data like ResultSet but it is easy and flexible to use.
A. True
B. False
C. none
29. JDBC RowSet is the wrapper of ResultSet,It holds tabular data like ResultSet but it is easy and flexible to use.
D. all
Answer» A. True
discuss
The ResultSet.next method is used to move to the next row of the ResultSet, making it the current row.
30.
A. True
B. False
C. none
D. all
Answer» A. True
discuss
31. Which JDBC product components does the Java software provide?
discuss
32. Which class has traditionally been the backbone of the JDBC architecture?
discuss
33. Which was the first most widely used programming interface for accessing relational databases and it offers the a
databases on all the platforms.?
A. JDBC API
B. ODBC API
C. Both A & B
discuss
34. 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» A. True
discuss
35. In the following JDBC drivers which is known as fully java driver?
A. Native-API driver
C. Thin driver
D. Both B & C
discuss
discuss
What is the reason that a java program cannot directly communicate with an ODBC driver?
37.
discuss
38. A leading database connectivity vendor, worked together to produce the ____.
A. JDBC-ODBC Bridge
C. Both A & B
discuss
39. Which driver converts JDBC calls directly into the vendor-specific database protocol?
C. Thin driver
D. Both B & C
40. Which models do the JDBC API support for the database access?
A. Two-tier models
B. Three-tier models
C. Both A & B
discuss
41. Which of the following JDBC drivers is known as a partially java driver?
B. Native-API driver
D. Thin driver
discuss
42. 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» A. True
discuss
D. Thin driver
discuss
How many JDBC product components does the Java software provides?
44.
A. 3
B. 2
C. 4
D. 5
Answer» A. 3
discuss
A. 3
B. 4
C. 2
D. 5
Answer» B. 4
discuss
46. Which method is used for an SQL statement that is executed frequently?
A. prepareStatement
B. prepareCall
C. createStatement
46. Which method is used for an SQL statement that is executed frequently?
Answer» A. prepareStatement
discuss
47. How is the dynamic interception of requests and responses to transform the information done?
A. servlet container
B. servlet config
C. servlet context
D. servlet filter
discuss
Which type of ServletEngine is a server that includes built-in support for servlets?
48.
A. Add-on ServletEngin
B. Embedded ServletEngine
C. Standalone ServletEngine
discuss
49. What type of servlets use these methods doGet(), doPost(),doHead, doDelete(), doTrace()?
A. Genereic Servlets
B. HttpServlets
Answer» B. HttpServlets
discuss
50. 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
51. Sessions is a part of the SessionTracking and it is for maintaining the client state at server side.
A. True
B. False
C. none
D. all
Answer» A. True
discuss
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. The destroy() method is called only once at the begining of the life cycle of a filter
Answer» A. The destroy() method is called only once at the end of the life cycle of a filter
discuss
53. Web server is used for loading the init() method of servlet.
A. True
B. False
C. none
D. all
Answer» A. True
discuss
54. Servlets handle multiple simultaneous requests by using threads.
A. True
B. False
C. none
D. all
Answer» A. True
discuss
Which method is used to send the same request and response objects to another servlet in RequestDispacher ?
55.
A. forward()
B. sendRedirect()
C. Both A & B
Answer» A. forward()
discuss
56. The sendRedirect() method of HttpServletResponse interface can be used to redirect response to another resourc
html file
A. True
B. False
C. none
D. all
Answer» A. True
discuss
57. Which packages represent interfaces and classes for servlet API?
A. javax.servlet
B. javax.servlet.http
57. Which packages represent interfaces and classes for servlet API?
C. Both A & B
discuss
58. Which class can handle any type of request so that it is protocol-independent?
A. GenericServlet
B. HttpServle
C. Both A & B
Answer» A. GenericServlet
discuss
A. GET
B. POST
C. Both A & B
discuss
60. Which object is created by the web container at time of deploying the project?
A. ServletConfig
B. ServletContext
C. Both A & B
Answer» B. ServletContext
discuss
61. What is the lifecycle of a servlet?
discuss
Which method in session tracking is used in a bit of information that is sent by a web server to a browser and wh
from that browser?
62.
A. HttpSession
B. URL rewriting
C. Cookies
Answer» C. Cookies
discuss
A. Apache
B. Tomcat
C. JBoss
D. Weblogic
Answer» C. JBoss
discuss
A. 4
64. How many techniques are used in Session Tracking?
B. 3
C. 2
D. 5
Answer» A. 4
discuss
In HTTP Request method Get request is secured because data is exposed in URL bar
65.
A. True
B. False
C. none
D. all
Answer» B. False
discuss
B. For each request, it starts a process and Web server is limited to start processes
discuss
A. True
B. False
C. none
D. all
69. What are functions of Servlet container?
A. Lifecycle management
B. Communication Support
C. Multithreading Support
Answer» A. True
discuss
68. Which method is used to specify before any lines that uses the PintWriter?
A. setPageType()
B. setContextType()
C. setContentType()
D. setResponseType()
Answer» C. setContentType()
discuss
discuss
70. Which object of HttpSession can be used to view and manipulate information about a session?
A. session identifier
B. creation time
discuss
71. Which methods are used to bind the objects on HttpSession instance and get the objects?
A. setAttribute
B. getAttribute
C. Both A & B
discuss
A. sendRedirect
B. forward
C. Both
D. None
Answer» A. sendRedirect
discuss
A. 1,2,3,4
B. 1,2
C. 1,2,3
D. 1,4
Answer» B. 1,2
discuss
A. servlet context
B. servlet container
discuss
75. 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)
discuss
What is the difference between servlets and applets? i. Servlets execute on Server; Applets execute on browser ii
has GUI iii. Servlets creates static web pages; Applets creates dynamic web pages iv. Servlets can handle only a sin
handle multiple requests
76.
B. i, ii are correct
discuss
77. Which are the session tracking techniques? i. URL rewriting ii. Using session object iii.Using response object iv. Us
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
discuss
A. must be same
C. may be same
discuss
discuss
Chapter: JSP
80. Which one is the correct order of phases in JSP life cycle?
discuss
81. Which technology do we mix our business logic with the presentation logic?
A. Servlet
B. JSP
C. Both A and B
Answer» A. Servlet
discuss
82. Which attribute specifies a JSP page that should process any exceptions thrown but not caught in the current pag
C. Both A & B
discuss
83. The ASP and JSP technologies are quite similar in the way they support the creation of Dynamic pages, using HTM
and components for business logic.
A. True
B. False
C. none
D. all
Answer» A. True
discuss
84. Which of the following is an advantage of the statement – Separation of business logic from JSP ?
discuss
85. JSPs eventually are compiled into Java servlets, you can do as much with JSPs as you can do with Java servlets.
A. True
B. False
C. none
D. all
Answer» A. True
discuss
86. JavaServer Pages often serve the same purpose as programs implemented using the Common Gateway Interface (CGI)
A. True
B. False
C. none
D. all
Answer» A. True
discuss
87. Which is the Microsoft solution for providing dynamic Web content?
A. ASP
B. JSP
C. Both A and B
Answer» A. ASP
discuss
A. Declaration Tag
B. Scriptlet tag
C. Expression tag
discuss
A. HTML tags
B. JSP tags
C. Both A & B
discuss
90. Which packages does a JSP API consist of?
A. javax.servlet.jsp
B. java.servlet
C. javax.servlet.jsp.tagext
D. Both A & C
discuss
91. Which of the scripting of JSP not putting content into service method of the converted servlet?
A. Declarations
B. Scriptlets
C. Expressions
Answer» C. Expressions
A. translation
B. compilation
C. syntax
D. Both A and B
Answer» C. syntax
A. static attributes
B. local attributes
C. dynamic attributes
D. global attributes
A. Response is slow
D. Both B and C
A. include
B. page
C. export
D. taglib
Answer» C. export
97. Which http method send by browser that asks the server to get the page only?
A. get
97. Which http method send by browser that asks the server to get the page only?
B. option
C. put
D. post
98. Which tag should be used to pass information from JSP to included JSP?
A. True
B. False
C. none
D. all
Answer» A. True
A. include
B. page
C.
export
D. useBean
Answer» C. export
A. servlet-mapping
99. _jspService() method of HttpJspPage class should not be overridden.
B. servlet-attr
C. servlet-flow
D. servlet-requests
Answer» A. servlet-mapping
discuss
A. ViewFacelets
B. ViewResolver
C. View-resolver
D. View_Resolver
Answer» B. ViewResolver
discuss
103. File extension of a view state’s name which is by default loaded by facelet page.
A. .xml
B. .hbm.xml
C. .xhtml
Answer» C. .xhtml
discuss
B. commandLink
C. invoking an action
discuss
105. For cross field validation or some sort of barrier to ensure state before you start a flow, we use.
A. FacesContext
B. FaceletContext
C. FacesResolver
Answer» A. FacesContext
discuss
106. Component which additionally provides a pop-up date picker control for its enclosed input field.
A. clientDateValidator
B. clientValidator
C. dateValidator
D. validator
Answer» A. clientDateValidator
discuss
A. validateAll
B. validateAllClick
C. validateAllInClick
D. validateAllOnClick
Answer» C. validateAllInClick
discuss
Chapter: Hibernate
A. Configuration
B. Criteria
C. SessionManagement
108. Which of the following is not a core interface of Hibernate?
D. Session
Answer» C. SessionManagement
discuss
A. JDBC
B. SessionFactory
C. Session
D. Configuration
Answer» A. JDBC
discuss
A. True
B. False
C. none
D. all
Answer» B. False
discuss
A. True
B. False
C. none
D. all
Answer» A. True
discuss
112. Which of the following methods returns proxy object?
A. loadDatabase()
B. getDatabase()
C. load()
D. get()
Answer» C. load()
discuss
A. load()
B. loadDatabase()
C. getDatabase()
D. get()
Answer» D. get()
discuss
A. merge()
B. update()
C. end()
D. kill()
Answer» B. update()
discuss
A. False
B. True
C. none
D. all
115. The SessionFactory is heavyweight object.
Answer» B. True
discuss
A. Attached()
B. Detached()
C. Persistent()
D. Transient()
Answer» A. Attached()
discuss
A. HQL takes java objects in the same way as SQL takes tables.
discuss
discuss
119. Which of the following is not an advantage of using Hibernate Query Language?
A. Database independent
119. Which of the following is not an advantage of using Hibernate Query Language?
D. Difficult to implement
discuss
A. .dbm
B. .hbm
C. .ora
D. .sql
Answer» B. .hbm
discuss
discuss
Chapter: Spring
A. Factory pattern
B. Singleton pattern
discuss
A. Spring web
B. Core container
C. AOP
D. Data access
discuss
124. What are beans in the concept of Spring or what are spring beans?
A. Controller classes
B. Service classes
C. Repository
discuss
B. Factory pattern
D. Singleton pattern
discuss
126. Which interface in spring is responsible for Instantiating and managing the so called Spring beans?
A. Bean Factory
126. Which interface in spring is responsible for Instantiating and managing the so called Spring beans?
B. ApplicationContext
C. BeanDefenition
D. BeanDefenition
Answer» B. ApplicationContext
discuss
A. Scope
B. Property
C. Class
discuss
A. name
B. id
C. class
D. constructor-args
Answer» C. class
discuss
129. Which of the following method can be used to used to instantiate a method?
B. default-init method
C. destroy method
D. lazy-init method
discuss
130. Which attribute is used to specify static factory-method?
A. factory-method
B. default-init method
C. destroy method
D. lazy-init method
Answer» A. factory-method
discuss
B. Initialize bean
discuss
More MCQs
A. java.io.date
B. java.sql.date
C. java.util.date
D. java.util.datetime
Answer» D. java.util.datetime
discuss
A. slow performance
D. better performance
discuss
A. slow performance
discuss
A. java.sql.timestamp
B. java.sql.time
C. java.io.time
D. java.io.timestamp
Answer» A. java.sql.timestamp
discuss
discuss
137. Which of the following is used to call stored procedure?
A. statement
B. preparedstatement
C. callablestatment
D. calledstatement
Answer» C. callablestatment
discuss
A. setbatch()
B. deletebatch()
C. removebatch()
D. addbatch()
Answer» D. addbatch()
discuss
A. rollback()
B. rollforward()
C. deletetransweraction()
D. removetransweraction()
Answer» A. rollback()
discuss
D. thin driver
140. Which driver uses ODBC driver to connect to the database?
discuss
141. How many JDBC product components does the Java software provides?
A. 3
B. 2
C. 4
D. 5
Answer» A. 3
discuss
A. 3
B. 4
C. 2
D. 5
Answer» B. 4
discuss
143. Which result set generally does not show changes to the underlying database
that are made while it is open. The membership, order, and column values of
rows are typically fixed when the result set is created?
A. type_forward_only
B. type_scroll_insensitive
C. type_scroll_sensitive
Answer» B. type_scroll_insensitive
discuss
144. Which method is used for an SQL statement that is executed frequently?
A. prepare statement
B. prepare call
C. create statement
discuss
A. statement interface
B. preparedstatement interface
C. resultset interface
discuss
146. Which JDBC product components does the Java software provide?
discuss
discuss
148. 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
discuss
149. 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
discuss
150. 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()
discuss
152. 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
discuss
153. JDBC facilitates to store the java objects by using which of the methods of
PreparedStatement
setObject () 2. setBlob() 3. setClob()
A. 1, 2
B. 1,2,3
C. 1,3
D. 2,3
Answer» B. 1,2,3
discuss
A. three tiered
B. multithreaded
Answer» B. multithreaded
discuss
155. 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
discuss
A. java)sql.time
B. java)util.date
C. java)util.time
Answer» B. java)util.date
discuss
157. 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
discuss
158. 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
158. Which of the following methods finds the maximum number of connections that a specific driver can
obtain?
D. resultsetmetadata)getmaxconnections
Answer» C. databasemetadata)getmaxconnections
discuss
B. when the user name, password and the database does not match
Answer» C. when the jdbc database url passed is not constructed properly
discuss
A. type-4 driver
B. type-1 driver
C. type-3 driver
D. type-2 driver
discuss
161. How many trAnsweraction isolation levels are defined in javA)sql.Connection interface?
A. 4
B. 3
C. 5
D. 2
Answer» C. 5
discuss
162. Which method is used to perform DML statements in JDBC?
A. execute()
B. executequery()
C. executeupdate()
D. executeresult()
Answer» C. executeupdate()
discuss
discuss
A. socket
B. ip address
C. protocol
D. mac address
Answer» C. protocol
discuss
165. In Inetaddress class which method returns the host name of IP address?
D. none
165. In Inetaddress class which method returns the host name of IP address?
discuss
A. all
B. ip address
C. protocol
D. mac address
Answer» A. all
discuss
167. Which classes are used for connection less socket programming?
A. datagram socket
B. datagram packet
C. both a and b
D. none
discuss
168. how many ports TCP/IP are reserved for specific protocol?
A. 10
B. 1024
C. 2048
D. 512
Answer» B. 1024
discuss
A. 8
169. how many bits are in a single IP address?
B. 16
C. 32
D. 64
Answer» C. 32
discuss
A. datagram packet
B. url
C. inetaddress
D. contenthandler
Answer» C. inetaddress
discuss
A. findaddress()
B. getaddress()
C. address()
D. whois()
Answer» B. getaddress()
discuss
A. port()
B. getport()
C. findport()
D. receivedport()
Answer» A. port()
discuss
173. Which of these class is necessary to implement datagrams?
A. datagrampacket
B. datagramsocket
discuss
174. Which of these method of DatagramPacket is used to find the port number?
A. port()
B. getport()
C. findport()
D. recieveport()
Answer» A. port()
discuss
175. 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()
discuss
176. Which of these method of DatagramPacket is used to find the length of byte array?
A. getnumber()
B. length()
C. length()
D. getlength()
176. Which of these method of DatagramPacket is used to find the length of byte array?
Answer» D. getlength()
discuss
A. run()
B. start()
C. runthread()
D. startthread()
Answer» A. run()
discuss
178. 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()
discuss
179. 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()
discuss
180. Which of these method of httpd class is used to get report on each hit to HTTP server?
A. log()
180. Which of these method of httpd class is used to get report on each hit to HTTP server?
B. logentry()
C. loghttpd()
D. logresponse()
Answer» B. logentry()
discuss
181. 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()
discuss
182. 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
discuss
183. 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()
discuss
184. Which of these is an instance variable of class httpd?
A. port
B. cache
C. log
discuss
A. port
B. cache
C. log
D. stopflag
Answer» C. log
discuss
A. urlnotfound
B. urlsourcenotfound
C. malformedurlexception
D. urlnotfoundexception
Answer» C. malformedurlexception
discuss
A. host()
B. gethost()
C. gethost()
D. gethost()
187. Which of these methods is used to know host of an URL?
Answer» B. gethost()
discuss
188. 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()
discuss
189. Which of these class is used to access actual bits or content information of a URL?
A. url
B. urldecoder
C. urlconnection
discuss
190. Which object of HttpSession can be used to view and manipulate information about a session?
A. session identifier
B. creation time
discuss
A. rmi communication
191. Which of these ways used to communicate from an applet to servlet?
B. http communication
C. socket communication
discuss
192. Which methods are used to bind the objects on HttpSession instance andget the objects?
A. setattribute
B. getattribute
C. both a & b
discuss
193. Which type of ServletEngine is a server that includes built-in support for servlets?
A. add-on servletengine
B. embedded servletengine
C. standalone servletengine
discuss
194. What type of servlets use these methods doGet(), doPost(),doHead, doDelete(), doTrace()?
A. genereic servlets
B. httpservlets
Answer» B. httpservlets
discuss
195. 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
discuss
196. 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
discuss
197. Which technology do we mix our business logic with the presentation logic?
A. servlet
B. jsp
C. both a & b
Answer» A. servlet
discuss
A. declaration tag
B. scriptlet tag
C. expression tag
discuss
Which JSP Action tags is used to include the content of another resource,it May be jsp, html or servlet?
199.
A. jsp:include
B. jsp:forward
C. jsp:plugin
D. jsp:papam
Answer» A. jsp:include
discuss
152. 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
discuss
153. JDBC facilitates to store the java objects by using which of the methods of
PreparedStatement
setObject () 2. setBlob() 3. setClob()
A. 1, 2
B. 1,2,3
C. 1,3
D. 2,3
Answer» B. 1,2,3
discuss
A. three tiered
B. multithreaded
Answer» B. multithreaded
discuss
155. 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
discuss
156. The class javA)sql.Timestamp has its super class as
A. java)sql.time
B. java)util.date
C. java)util.time
Answer» B. java)util.date
discuss
157. 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
discuss
158. 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
discuss
B. when the user name, password and the database does not match
Answer» C. when the jdbc database url passed is not constructed properly
discuss
160. 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
discuss
161. How many trAnsweraction isolation levels are defined in javA)sql.Connection interface?
A. 4
B. 3
C. 5
D. 2
Answer» C. 5
discuss
A. execute()
B. executequery()
C. executeupdate()
D. executeresult()
Answer» C. executeupdate()
discuss
163. What is the disadvantage of Type-4 Native-Protocol Driver?
discuss
A. socket
B. ip address
C. protocol
D. mac address
Answer» C. protocol
discuss
165. In Inetaddress class which method returns the host name of IP address?
D. none
discuss
A. all
B. ip address
C. protocol
D. mac address
Answer» A. all
discuss
167. Which classes are used for connection less socket programming?
A. datagram socket
B. datagram packet
C. both a and b
D. none
discuss
168. how many ports TCP/IP are reserved for specific protocol?
A. 10
B. 1024
C. 2048
D. 512
Answer» B. 1024
discuss
A. 8
B. 16
C. 32
D. 64
Answer» C. 32
discuss
A. datagram packet
B. url
C. inetaddress
D. contenthandler
Answer» C. inetaddress
discuss
171. Which of these is return type of getAddress method of DatagramPacket class?
A. findaddress()
B. getaddress()
C. address()
D. whois()
Answer» B. getaddress()
discuss
A. port()
B. getport()
C. findport()
D. receivedport()
Answer» A. port()
discuss
A. datagrampacket
B. datagramsocket
discuss
174. Which of these method of DatagramPacket is used to find the port number?
A. port()
B. getport()
C. findport()
D. recieveport()
Answer» A. port()
discuss
175. 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()
discuss
176. 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()
discuss
A. run()
B. start()
C. runthread()
D. startthread()
Answer» A. run()
discuss
178. 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()
discuss
179. 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()
discuss
180. 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()
discuss
181. 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()
discuss
182. 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
discuss
183. 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()
discuss
A. port
B. cache
C. log
discuss
185. Which of these is an instance variable of httpd that is a Hashtable?
A. port
B. cache
C. log
D. stopflag
Answer» C. log
discuss
A. urlnotfound
B. urlsourcenotfound
C. malformedurlexception
D. urlnotfoundexception
Answer» C. malformedurlexception
discuss
A. host()
B. gethost()
C. gethost()
D. gethost()
Answer» B. gethost()
discuss
188. 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()
discuss
189. Which of these class is used to access actual bits or content information of a URL?
A. url
B. urldecoder
C. urlconnection
discuss
190. Which object of HttpSession can be used to view and manipulate information about a session?
A. session identifier
B. creation time
discuss
A. rmi communication
B. http communication
C. socket communication
discuss
192. Which methods are used to bind the objects on HttpSession instance andget the objects?
A. setattribute
B. getattribute
C. both a & b
discuss
193. Which type of ServletEngine is a server that includes built-in support for servlets?
A. add-on servletengine
B. embedded servletengine
C. standalone servletengine
discuss
194. What type of servlets use these methods doGet(), doPost(),doHead, doDelete(), doTrace()?
A. genereic servlets
B. httpservlets
Answer» B. httpservlets
discuss
195. 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
discuss
196. 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
discuss
197. Which technology do we mix our business logic with the presentation logic?
A. servlet
B. jsp
C. both a & b
Answer» A. servlet
discuss
A. declaration tag
B. scriptlet tag
C. expression tag
discuss
199. 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
discuss
201. 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
discuss
A. html tags
B. jsp tags
C. both a & b
discuss
203. What alternatives exist to embedding Java code directly within the HTML markup of your JSP page?
discuss
204. What type of scriptlet code is better-suited to being factored forward into a servlet?
Answer» A. code that deals with logic that is common across requests.
discuss
205. 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
discuss
206. Which of the scripting of JSP not putting content into service method of the converted servlet?
A. declarations
B. scriptlets
C. expressions
Answer» A. declarations
discuss
A. thread
B. process
Answer» A. thread
discuss
208. What does not prevent JVM from terminating?
A. process
B. daemon thread
C. user thread
D. jvm thread
discuss
A. process
B. process scheduler
C. thread
D. thread scheduler
discuss
discuss
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
discuss
212. Which of the following is a correct constructor for thread?
B. thread(int priority)
D. thread(runnable a, threadgroup t)
discuss
213. 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()
discuss
A. process based
B. thread based
discuss
215 What will happen if two thread of the same priority are called to be processed simultaneously?
discuss
216. In a RMI Client Program, what are the exceptions which might have to handled?
A. remoteexception
B. notboundexception
C. malformedurlexception
discuss
217. Which is a one-way communication only between the client and the server and it
is not a reliable and there is no confirmation regarding reaching the message to
the destination?
A. tcp/ip
B. udp
C. both a & b
Answer» B. udp
discuss
discuss
discuss
220. 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
Answer» B. client
discuss
A. java.lang.rmi
B. java.lang.reflect
C. java.applet
D. java.rmi
Answer» D. java.rmi
Java supports RMI, RMI Stands for?
222.
discuss
discuss
A. ejb
B. rmi
C. both a & b
Answer» B. rmi
discuss
A. java.io.date
B. java.sql.date
C. java.util.date
D. java.util.datetime
Answer» D. java.util.datetime
discuss
A. slow performance
D. better performance
discuss
226. Which of the following is advantage of using PreparedStatement in Java?
A. slow performance
discuss
A. java.sql.timestamp
B. java.sql.time
C. java.io.time
D. java.io.timestamp
Answer» A. java.sql.timestamp
discuss
discuss
Which of the following is used to call stored procedure?
229.
A. statement
B. preparedstatement
C. callablestatment
D. calledstatement
Answer» C. callablestatment
discuss
A. setbatch()
B. deletebatch()
C. removebatch()
D. addbatch()
Answer» D. addbatch()
discuss
A. rollback()
B. rollforward()
C. deletetransweraction()
D. removetransweraction()
Answer» A. rollback()
discuss
D. thin driver
discuss
233. How many JDBC product components does the Java software provides?
A. 3
B. 2
C. 4
D. 5
Answer» A. 3
discuss
A. 3
B. 4
C. 2
D. 5
Answer» B. 4
discuss
. Which result set generally does not show changes to the underlying database
that are made while it is open. The membership, order, and column values of
rows are typically fixed when the result set is created?
A. type_forward_only
B. type_scroll_insensitive
C. type_scroll_sensitive
Answer» B. type_scroll_insensitive
discuss
Which method is used for an SQL statement that is executed frequently?
A. prepare statement
B. prepare call
C. create statement
discuss
A. statement interface
B. preparedstatement interface
C. resultset interface
discuss
discuss
discuss
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
discuss
. 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
discuss
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()
discuss
Which of the following is false as far as type 4 driver is concern?
discuss
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
discuss
JDBC facilitates to store the java objects by using which of the methods of
PreparedStatement
setObject () 2. setBlob() 3. setClob()
A. 1, 2
B. 1,2,3
C. 1,3
D. 2,3
Answer» B. 1,2,3
discuss
A. three tiered
B. multithreaded
Answer» B. multithreaded
discuss
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
discuss
A. java)sql.time
B. java)util.date
C. java)util.time
Answer» B. java)util.date
discuss
A. jdbc 1.0
B. jdbc 4.0
C. jdbc 2.0
D. jdbc 3.0
discuss
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
discuss
B. when the user name, password and the database does not match
Answer» C. when the jdbc database url passed is not constructed properly
discuss
A. type-4 driver
B. type-1 driver
C. type-3 driver
D. type-2 driver
discuss
A. 4
B. 3
C. 5
D. 2
Answer» C. 5
discuss
Which method is used to perform DML statements in JDBC?
A. execute()
B. executequery()
C. executeupdate()
D. executeresult()
Answer» C. executeupdate()
discuss
discuss
A. socket
B. ip address
C. protocol
D. mac address
Answer» C. protocol
discuss
In Inetaddress class which method returns the host name of IP address?
D. none
discuss
A. all
B. ip address
C. protocol
D. mac address
Answer» A. all
discuss
A. datagram socket
B. datagram packet
C. both a and b
D. none
discuss
A. 10
B. 1024
C. 2048
D. 512
Answer» B. 1024
discuss
how many bits are in a single IP address?
A. 8
B. 16
C. 32
D. 64
Answer» C. 32
discuss
A. datagram packet
B. url
C. inetaddress
D. contenthandler
Answer» C. inetaddress
discuss
A. findaddress()
B. getaddress()
C. address()
D. whois()
Answer» B. getaddress()
discuss
Which of these method of DatagramPacket is used to find port number?
A. port()
B. getport()
C. findport()
D. receivedport()
Answer» A. port()
discuss
A. datagrampacket
B. datagramsocket
discuss
A. port()
B. getport()
C. findport()
D. recieveport()
Answer» A. port()
discuss
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()
discuss
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()
discuss
A. run()
B. start()
C. runthread()
D. startthread()
Answer» A. run()
discuss
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()
discuss
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()
discuss
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()
discuss
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()
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
discuss
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()
discuss
A. port
B. cache
C. log
A. port
B. cache
C. log
D. stopflag
Answer» C. log
discuss
Which of these exception is thrown by URL class’s constructors?
A. urlnotfound
B. urlsourcenotfound
C. malformedurlexception
D. urlnotfoundexception
Answer» C. malformedurlexception
discuss
A. host()
B. gethost()
C. gethost()
D. gethost()
Answer» B. gethost()
discuss
. 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()
discuss
Which of these class is used to access actual bits or content information of a URL?
A. url
B. urldecoder
C. urlconnection
discuss
. Which object of HttpSession can be used to view and manipulate information about a session?
A. session identifier
B. creation time
discuss
A. rmi communication
B. http communication
C. socket communication
discuss
Which methods are used to bind the objects on HttpSession instance andget the objects?
A. setattribute
B. getattribute
C. both a & b
discuss
Which type of ServletEngine is a server that includes built-in support for servlets?
A. add-on servletengine
B. embedded servletengine
C. standalone servletengine
discuss
What type of servlets use these methods doGet(), doPost(),doHead, doDelete(), doTrace()?
A. genereic servlets
B. httpservlets
Answer» B. httpservlets
discuss
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
discuss
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
A. servlet
B. jsp
C. both a & b
Answer» A. servlet
discuss
A. declaration tag
B. scriptlet tag
C. expression tag
discuss
. 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
discuss
In JSP how many ways are there to perform exception handling?
A. 3
B. 2
C. 4
D. 5
Answer» B. 2
discuss
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
discuss
A. html tags
B. jsp tags
C. both a & b
discuss
What alternatives exist to embedding Java code directly within the HTML markup of your JSP page?
discuss
What type of scriptlet code is better-suited to being factored forward into a servlet?
Answer» A. code that deals with logic that is common across requests.
discuss
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
discuss
Which of the scripting of JSP not putting content into service method of the converted servlet?
A. declarations
B. scriptlets
C. expressions
Answer» A. declarations
discuss
A. thread
B. process
Answer» A. thread
What does not prevent JVM from terminating?
A. process
B. daemon thread
C. user thread
D. jvm thread
discuss
A. process
B. process scheduler
C. thread
D. thread scheduler
discuss
discuss
What is true about threading?
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
discuss
B. thread(int priority)
D. thread(runnable a, threadgroup t)
discuss
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()
discuss
A. process based
B. thread based
discuss
What will happen if two thread of the same priority are called to be processed simultaneously?
discuss
In a RMI Client Program, what are the exceptions which might have to handled?
A. remoteexception
B. notboundexception
C. malformedurlexception
discuss
Which is a one-way communication only between the client and the server and it
is not a reliable and there is no confirmation regarding reaching the message to
the destination?
A. tcp/ip
B. udp
C. both a & b
Answer» B. udp
discuss
An RMI Server is responsible for,
discuss
discuss
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
Answer» B. client
discuss
A. java.lang.rmi
B. java.lang.reflect
C. java.applet
D. java.rmi
Answer» D. java.rmi
discuss
. Java supports RMI, RMI Stands for?