Workbook Ajp Al Unit
Workbook Ajp Al Unit
Workbook Ajp Al Unit
JSPM’s
JAYAWANTRAO SAWANT POLYTECHNIC
Sr. No. 58, Handewadi Road, Hadapsar, Pune- 28.
Department of Computer Engineering
Academic Year 2024-25
Workbook-I
1. AWT Means?
a) Container
b) Component
c) Frame
d) Panel
3. The setSize( ) method is defined by this class…
a) Applet
b) Component
c) Frame
d) Panel
4. Which class encapsulates a blank window upon which we can draw?
a) Applet
b) Canvas
c) Window
d) Frame
5. What are the variables defined in ‘Dimension’ class?
b) show( )
c) setHidden( )
d) view( )
7. The setColor( ) is the method of which class?
a) Applet
b) Graphics
c) Color
d) Object
b) Font.ITALIC
c) Font.PLAIN
d) Font.BOLD
e) Component
f) Container
g) AWTControl
h) Window
10. How you can remove all the controls from the applet?
JSPM’s
JAYAWANTRAO SAWANT POLYTECHNIC
Sr. No. 58, Handewadi Road, Hadapsar, Pune- 28.
Department of Computer Engineering
Academic Year 2024-25
Workbook-II
6 JFrame myFrame = new JFrame (); Any command (such as the one listed above) which creates a new
object of a specific class (in this case a new JFrame object called myFrame) is generally called a ...
A. Constructor
B. Layout manager
C. Parameter
D. GUI
7 In Java, what do you call an area on the screen that has nice borders and various buttons along the top
border?
A. A window
B. A screen
C. A box
D. A frame
9 What is the name of the Swing class that is used for frames?
A. Window
B. Frame
C. JFrame
D. SwingFrame
10 The following specifies the advantages of
It is lightweight.
It supports pluggable look and feel.
It follows MVC (Model View Controller) architecture.
A) Swing
B) AWT
C) Both A & B
D) None of the above
JSPM’s
JAYAWANTRAO SAWANT POLYTECHNIC
Sr. No. 58, Handewadi Road, Hadapsar, Pune- 28.
Department of Computer Engineering
Academic Year 2024-25
Workbook-III
1. Which of these packages contains all the classes and methods required for even handling in Java?
a) java.applet
b) java.awt
c) java.event
d) java.awt.event
JSPM’s
JAYAWANTRAO SAWANT POLYTECHNIC
Sr. No. 58, Handewadi Road, Hadapsar, Pune- 28.
Department of Computer Engineering
Academic Year 2024-25
Workbook-IV
2. UDP
3. IP
4. HTTP
2. 23
3. 47
4. 92
3 Which protocol that web browsers and servers use to transfer hypertext pages and images?
1. TCP/IP
2. UDP
3. HTTP
4. SMTP
2. 16
3. 24
4. 8
6 What is URL?
1. Unicast Resource Location
8. Which class is used to encapsulate both the numerical IP address and the domain name for that
address?
a) InetAddress
b) SocketAddress
c) IPAdress
d) DNSSockets
f) InetAddress(int port)
g) InetAddress(URL url)
10. Factory method of InetAddress class throws which of the following exception?
e) MalFormedURLException
f) UnknownHostException
g) URLException
h) MalFormedURLIOException
12. Which class is used to encapsulate both the numerical IP address and the domain name for that
address?
e) InetAddress
f) SocketAddress
g) IPAdress
h) DNSSockets
f) InetAddress(int port)
g) InetAddress(URL url)
e) MalFormedURLException
f) UnknownHostException
g) URLException
h) MalFormedURLIOException
f) InetAddress
g) URL[ ]
h) URL
e) int[ ]
f) byte[ ]
g) long[ ]
h) String
17. Which method returns a string that represents the host name associated with the InetAddress
object?
e) hostName( )
f) myHostName( )
g) giveHostName( )
h) getHostName( )
18. Which Java networking class is designed to be a listener, and for clients to connect before doing
anything?
e) Server
ServerSocket
a) Servers
b) Socket
e) URLException
f) UnknownHostException
g) MalFormedURLException
h) None
f) Site number
g) URL Uniform number
JSPM’s
JAYAWANTRAO SAWANT POLYTECHNIC
Sr. No. 58, Handewadi Road, Hadapsar, Pune- 28.
Department of Computer Engineering
Academic Year 2024-25
Workbook-V
. A Java program cannot directly communicate with an ODBC driver because .......
A) ODBC written in C language
B) ODBC written in C# language
C) ODBC written in C++ language
D) ODBC written in Basic language
2. The JDBC-ODBC Bridge driver translates the JDBC API to the ODBC API and used with .......
A) JDBC drivers
B) ODBC drivers
C) Both A and B
3. The ............................. package contains classes that help in connecting to a database, sending
SQL statements to the database, and processing the query results.
A) connection.sql
B) db.sql
C) pkg.sql
D) java.sql
4. The ................................ method executes a simple query and returns a single Result Set object.
A) executeUpdate()
B) executeQuery()
C) execute()
D) noexecute()
5. The ......................... method executes an SQL statement that may return multiple results.
A) executeUpdate()
B) executeQuery()
C) execute()
D) noexecute()
A) ResultSet
B) Parametrized
C) PreparedStatement
D) Condition
7. The .................. object provides you with methods to access data from the table.
A) ResultSet
B) Parametrized
C) TableStatement
D) Condition
8. The parameters of the PreparedStatement object are ...................... when the user clicks on the
Query button.
9. The ...................... method sets the query parameters of the PreparedStatement Object.
10. Connection object can be initialized using the ............................ method of the Driver Manager
class.
12.In which of the following type of ResultSet, the cursor can scroll forwards and backwards, and
the result set is not sensitive to changes made by others to the database that occur after the result
set was created.?
A - ResultSet.TYPE_FORWARD_ONLY
B - ResultSet.TYPE_SCROLL_INSENSITIVE
C - ResultSet.TYPE_SCROLL_SENSITIVE
D - None of the above.
13. Which of the following type of JDBC driver should be used where a type 3 or type 4 driver is
not available yet for your database?
A - Type 1 B - Type 2 C - Type 3 D - Type 4
17.Out of byte[] or a java.sql.Blob, which has best performance when used to manipulate data
from database?
A - byte[] B - java.sql.Blob
Workbook-VI
A - The servlet container (i.e. web server) calls the service() method to handle requests coming from the client.
B - Each time the server receives a request for a servlet, the server spawns a new thread and calls service.
C - The service() method checks the HTTP request type (GET, POST, PUT, DELETE, etc.) and calls doGet,
doPost, doPut, doDelete, etc. methods as appropriate.
ANS : ________
Q 2 - Which of the following method can be used to get the multiple values of a parameter like checkbox
data?
A - request.getParameter()
B - request.getParameterValues()
C - request.getParameterNames()
ANS : ________
A - request.getSession()
B - response.getSession()
C - new Session()
ANS : ________
B - response.getParameter(name)
C - request.getParameter(name)
ANS : ________
Q 5 - Which of the following code encodes the specified URL by including the session ID in it?
A - response.encodeURL(url)
B - request.encodeURL(url)
C - Header.encodeURL(url)
ANS : ________
Q 6 - Which of the following code can be used to add a header with the given name and integer value?
A - request.addHeader(name,value)
B - response.addIntHeader(name,value)
C - Header.addDateHeader(name,value)
ANS : ________
Q 7 - Which of the following code can be used to set the content type for the body of the response?
A - request.setContentType(type)
B - response.setContentType(type)
C - header.setContentType(type)
ANS : ________
A - This attribute gives exact error message which can be stored and analysed after storing in a java.lang.String
data type.
B - This attribute gives information about exception type which can be stored and analysed after storing in a
java.lang.Class data type.
C - This attribute gives status code which can be stored and analysed after storing in a java.lang.Integer data
type.
D - This attribute gives information about URL calling the servlet and it can be stored and analysed after storing
in a java.lang.String data type.
ANS : ________
Q 9 - Which of the following code is used to get session id of a HTTP Session object in servlets?
A - session.getSessionId()
B - session.getId()
C - session.getActiveId()
ANS : ________
Q 10 - Which of the following code is used to set the session timeout in servlets?
A - session.setMaxInactiveInterval(interval)
B - response.setMaxInactiveInterval(interval)
C - request.setMaxInactiveInterval(interval)
ANS : ________