Java MCQ Questions for Placement - Set 4

1)   What is the built on top of the socket programming?

a. EJB
b. RMI
c. Both A & B
d. None of the above
Answer  Explanation 

ANSWER: RMI

Explanation:
No explanation is available for this question!


2)   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  Explanation 

ANSWER: Both A & B

Explanation:
No explanation is available for this question!


3)   Which applet java.awt.component class provides the life cycle method?

a. public void paint(Graphics g)
b. public void destroy()
c. public void stop()
d. public void init()
Answer  Explanation 

ANSWER: public void paint(Graphics g)

Explanation:
No explanation is available for this question!


4)   Where can the event handling code be written?

a. Same class
b. Other class
c. Anonymous class
d. All mentioned above
Answer  Explanation 

ANSWER: All mentioned above

Explanation:
No explanation is available for this question!


5)   Which package acts as an object -oriented wrapper around most common databases provided by java?

a. JDBC
b. ODBC
c. None of the above
d. None of these
Answer  Explanation 

ANSWER: JDBC

Explanation:
No explanation is available for this question!


6)   XML is designed to store data and _____.

a. Design
b. Verify
c. Transport
d. Both A & B
Answer  Explanation 

ANSWER: Transport

Explanation:
No explanation is available for this question!


7)   XML documents must contain a root element; this element is 'the parent' of all other elements

a. True
b. False
Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


8)   Which are the XML Syntax rules?

a. All XML Elements Must Have a Closing Tag
b. XML Tags are not Case Sensitive
c. XML Elements Must be Properly Nested
d. Both A & C
Answer  Explanation 

ANSWER: Both A & C

Explanation:
No explanation is available for this question!


9)   The URLConnection class can be used to read and write data to the specified resource referred by the URL

a. True
b. False
Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


10)   The client in socket programming must know which informations?

a. IPaddress of Server
b. Port number
c. Both A & B
d. None of the above
Answer  Explanation 

ANSWER: Both A & B

Explanation:
No explanation is available for this question!


11)   Which method cannot be overridden?

a. Final Method
b. Final class
c. Final Variable
d. Both A & C
Answer  Explanation 

ANSWER: Final Method

Explanation:
No explanation is available for this question!


12)   Which class cannot be instantiated?

a. Abstract Class
b. Static Class
c. Both A & B
d. None of the above
Answer  Explanation 

ANSWER: Abstract Class

Explanation:
No explanation is available for this question!


13)   What is used to convert the byte-oriented stream into character-oriented stream?

a. Console
b. Scanner
c. InputStreamReader
d. DataInputStream
Answer  Explanation 

ANSWER: InputStreamReader

Explanation:
No explanation is available for this question!


14)   Which method is used in thread class to test if the current thread has been interrupted?

a. public static boolean interrupted()
b. public boolean isInterrupted()
c. public void interrupt()
d. public boolean isAlive()
Answer  Explanation 

ANSWER: public static boolean interrupted()

Explanation:
No explanation is available for this question!


15)   Which type of java package that contains wide range of classes and methods are used for performing different functionalities?

a. User Defined Package
b. Java System Packages
c. User System Packages
d. None of the above
Answer  Explanation 

ANSWER: Java System Packages

Explanation:
No explanation is available for this question!


16)   Which concept is used to make Java more memory efficient (because no new objects are created if it exists already in string constant pool)?

a. String literal
b. By new keyword
c. Both A & B
d. None of the above
Answer  Explanation 

ANSWER: String literal

Explanation:
No explanation is available for this question!


17)   Find whether these two rules are correct or not defined by the constructor 1. Constructor name must be same as its class name. 2. Constructor must have no explicit return type.

a. True
b. False
Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


18)   Which are also known as inner classes?

a. Non-static nested class
b. Static nested class
c. Nested class
d. None of the above
Answer  Explanation 

ANSWER: Non-static nested class

Explanation:
No explanation is available for this question!


19)   Which driver converts JDBC calls directly into the vendor-specific database protocol?

a. Native - API driver
b. Network Protocol driver
c. Thin driver
d. Both B & C
Answer  Explanation 

ANSWER: Thin driver

Explanation:
No explanation is available for this question!


20)   Which one of the following scopes does the attribute in servlet is an object that can be set, get or removed?

a. session scope
b. request scope
c. application scope
d. All mentioned above
Answer  Explanation 

ANSWER: All mentioned above

Explanation:
No explanation is available for this question!


21)   Which method is easy for a java programmer to add a criteria?

a. HCQL
b. HQL
c. SQL
d. None of the above
Answer  Explanation 

ANSWER: HCQL

Explanation:
No explanation is available for this question!


22)   POJO means you are not forced to implement any interface or extend any class.

a. True
b. False
Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


23)   How many types of session beans are available in EJB?

a. 2
b. 3
c. 4
d. 5
Answer  Explanation 

ANSWER: 3

Explanation:
No explanation is available for this question!


24)   Which method of the Naming class (found in java.rmi) is used to update the RMI registry on the server machine?

a. rebind ()
b. lookup()
c. Both A & B
d. None of the above
Answer  Explanation 

ANSWER: rebind ()

Explanation:
No explanation is available for this question!


25)   In JSP page directive which attribute defines the MIME(Multipurpose Internet Mail Extension) type of the HTTP response?

a. import
b. Content Type
c. Extends
d. Info
Answer  Explanation 

ANSWER: Content Type

Explanation:
No explanation is available for this question!


26)   A leading database connectivity vendor, worked together to produce the ____.

a. JDBC-ODBC Bridge
b. JDBC Driver Test Suite
c. Both A & B
d. None of the above
Answer  Explanation 

ANSWER: Both A & B

Explanation:
No explanation is available for this question!


27)   Which method is first Called for any applet when it starts its execution?

a. void init()
b. void destroy()
c. boolean isActive()
d. None of the above
Answer  Explanation 

ANSWER: void init()

Explanation:
No explanation is available for this question!


28)   When an applet begins, in which sequence will the AWT call the methods?

a. init(),paint(),start()
b. Start(),paint(),init()
c. intit(),start(),paint()
d. paint(),start(),init()
Answer  Explanation 

ANSWER: intit(),start(),paint()

Explanation:
No explanation is available for this question!


29)   The Following steps are required to perform (1) Implement the Listener interface and overrides its methods (2) Register the component with the Listener

a. Exception Handling
b. String Handling
c. Event Handling
d. None of the above
Answer  Explanation 

ANSWER: Event Handling

Explanation:
No explanation is available for this question!


30)   Void is not a wrapper class

a. True
b. False
Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!