Java Test Questions Set 11

1)   By interface, we cannot support the functionality of multiple inheritances.

a. True
b. False


Answer  Explanation 

ANSWER: False

Explanation:
No explanation is available for this question!


2)   The Java Virtual Machine is the cornerstone of the Java platform.

a. True
b. False


Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


3)   Which method of DataInputStream class reads a line from the file and returns it as a string?

a. WriteInt()
b. readLine()
c. readInt()
d. writeDouble()
Answer  Explanation 

ANSWER: readLine()

Explanation:
No explanation is available for this question!


4)   Which state is the thread still alive, but is currently not eligible to run?

a. Non-Runnable
b. Terminated
c. Runnable
d. Running
Answer  Explanation 

ANSWER: Non-Runnable

Explanation:
No explanation is available for this question!


5)   Both threads are waiting for each other to release the lock, the condition is called deadlock.

a. True
b. False


Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


6)   How many ways are there to access package from another package?

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

ANSWER: 3

Explanation:
No explanation is available for this question!


7)   Under which package is the string class encapsulated?

a. java.lang
b. java.util
c. java.io
d. java.awt
Answer  Explanation 

ANSWER: java.lang

Explanation:
No explanation is available for this question!


8)   Which keyword is used for the block to handle the exceptions generated by try block?

a. Catch
b. Final
c. throw
d. try
Answer  Explanation 

ANSWER: Catch

Explanation:
No explanation is available for this question!


9)   Nested interface must be public if it is declared outside the interface but it cannot have any access modifier if declared within the class.

a. True
b. False


Answer  Explanation 

ANSWER: False

Explanation:
No explanation is available for this question!


10)   What is used to execute parameterized query?

a. Statement interface
b. PreparedStatement interface
c. ResultSet interface
d. None of the above
Answer  Explanation 

ANSWER: PreparedStatement interface

Explanation:
No explanation is available for this question!


11)   Which class can handle any type of request so that it is protocol-independent?

a. GenericServlet
b. HttpServlet
c. Both A & B
d. None of the above
Answer  Explanation 

ANSWER: GenericServlet

Explanation:
No explanation is available for this question!


12)   Which ways are used by the Log4j and Logback frameworks in hibernate framework to support logging?

a. By log4j.xml file
b. By log4j.properties
c. Both A & B
d. None of the above
Answer  Explanation 

ANSWER: Both A & B

Explanation:
No explanation is available for this question!


13)   Which interface must be implemented by the Action class to store the information in the session scope?

a. SessionAware Interface
b. ServletContextAware Interface
c. Both A & B
d. None of the above
Answer  Explanation 

ANSWER: SessionAware Interface

Explanation:
No explanation is available for this question!


14)   The life cycle of session bean is not maintained by the application server (EJB Container).

a. True
b. False


Answer  Explanation 

ANSWER: False

Explanation:
No explanation is available for this question!


15)   Which objects are used by RMI for communicating with the remote object?

a. Stub
b. Skeleton
c. Both A & B
d. None of the above
Answer  Explanation 

ANSWER: Both A & B

Explanation:
No explanation is available for this question!


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

ANSWER: Servlet

Explanation:
No explanation is available for this question!


17)   Which method is used for an SQL statement that is executed frequently?

a. prepareStatement
b. prepareCall
c. createStatement
d. None of the above
Answer  Explanation 

ANSWER: prepareStatement

Explanation:
No explanation is available for this question!


18)   Which is a special type of program that is embedded in the webpage to generate the dynamic content?

a. Package
b. Applet
c. Browser
d. None of the above
Answer  Explanation 

ANSWER: Applet

Explanation:
No explanation is available for this question!


19)   Applet runs inside the browser and does not works at client side.

a. True
b. False


Answer  Explanation 

ANSWER: False

Explanation:
No explanation is available for this question!


20)   Which are passive controls that do not support any interaction with the user?

a. Choice
b. List
c. Labels
d. Checkbox
Answer  Explanation 

ANSWER: Labels

Explanation:
No explanation is available for this question!


21)   AWT has more powerful components like tables, lists, scroll panes, color chooser, tabbed pane etc.

a. True
b. False


Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


22)   Filtered streams are simply wrappers around underlying input or output streams that transparently provide some extended level of functionality.

a. True
b. False


Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


23)   Find the correct syntax of the declaration which defines the XML Version?

a. < ?xml version= "1.0" ? >
b. < xml version="1.0"/ >
c. < ?xml version="1.0" / >
d. None of the above
Answer  Explanation 

ANSWER: < ?xml version= "1.0" ? >

Explanation:
No explanation is available for this question!


24)   Which is used about text data that should not be parsed by the XML parser?

a. CDATA
b. PCDATA
c. None of the above

Answer  Explanation 

ANSWER: CDATA

Explanation:
No explanation is available for this question!


25)   XML stands for?

a. Extensible Markup Language
b. Extended Mashup Language
c. Extensible Mashup Language
d. X-Markup Language
Answer  Explanation 

ANSWER: Extensible Markup Language

Explanation:
No explanation is available for this question!