Java Test Questions Set 2

1)   Which inheritance is not supported in java?

a. Single inheritance
b. Multiple
c. Multilevel inheritance
d. Hybrid
e. Java supports all of the above
Answer  Explanation 

ANSWER: Java supports all of the above

Explanation:
No explanation is available for this question!


2)   Which provides a new way for your programs to interface with code libraries written in other languages?

a. JNI
b. JDBC
c. RMI
d. GUI
Answer  Explanation 

ANSWER: JNI

Explanation:
No explanation is available for this question!


3)   Which is used as an internal buffer and adds more efficiency than to write data directly into a stream. So, as to makes the performance fast?

a. BufferedOutputStream
b. ByteArrayOutputStream
c. BufferedInputStream
d. ByteArrayInputStream
Answer  Explanation 

ANSWER: BufferedOutputStream

Explanation:
No explanation is available for this question!


4)   In how many states Threads can be explained ?

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

ANSWER: 5

Explanation:
No explanation is available for this question!


5)   Which of the following ways specify/ies to load the class files in temporary?

a. By setting the classpath in the command prompt
b. By classpath switch
c. Both A & B
d. None of the above
Answer  Explanation 

ANSWER: Both A & B

Explanation:
No explanation is available for this question!


6)   The object cloning is a way to create exact copy of an object

a. True
b. False


Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


7)   If the superclass method does not declare an exception, subclass overridden method cannot declare the checked exception but it can declare unchecked exception.

a. True
b. False


Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


8)   Which field cannot be changed after the object has been constructed?

a. Static field
b. Non-static field
c. Final field
d. Naming field
Answer  Explanation 

ANSWER: Final field

Explanation:
No explanation is available for this question!


9)   How many types of JDBC drivers are available?

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

ANSWER: 4

Explanation:
No explanation is available for this question!


10)   In the following statements identify the disadvantages of CGI?

a. If number of clients increases, it takes more time for sending response
b. For each request, it starts a process and Web server is limited to start processes
c. It uses platform dependent language e.g. C, C++, perl
d. All mentioned above
Answer  Explanation 

ANSWER: All mentioned above

Explanation:
No explanation is available for this question!


11)   Hibernate framework simplifies the development of java application to interact with the database


a. True
b. False


Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


12)   What is responsible in MVC for managing the data of the application which responds to the request from the view as well as to the instructions from the controller to update itself?

a. View
b. Model
c. Controller
d. None of the above
Answer  Explanation 

ANSWER: Model

Explanation:
No explanation is available for this question!


13)   The i18n interceptor provides multi-lingual support for your application

a. True
b. False


Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


14)   Which session bean does the conversational state between multiple method calls is not maintained by the container?

a. Stateful Session Bean
b. Stateless Session Bean
c. Singleton Session Bean
d. None of the above
Answer  Explanation 

ANSWER: Stateless Session Bean

Explanation:
No explanation is available for this question!


15)   In RMI Distributed object applications need to

a. Locate remote objects
b. Communicate with remote objects
c. Load class definitions for objects that are passed around
d. All mentioned above
Answer  Explanation 

ANSWER: All mentioned above

Explanation:
No explanation is available for this question!


16)    Which packages does a JSP API consist of?

a. javax.servlet.jsp
b. java.servlet
c. javax.servlet.jsp.tagext
d. Both A & C
Answer  Explanation 

ANSWER: Both A & C

Explanation:
No explanation is available for this question!


17)   How many JDBC product components does the Java software provides?

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

ANSWER: 3

Explanation:
No explanation is available for this question!


18)   Applet runs inside the browser and works at client side

a. True
b. False


Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


19)   AWT is used for GUI programming in java

a. True
b. False


Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


20)   TCP,FTP,Telnet,SMTP,POP etc. are examples of ?

a. Socket
b. IP Address
c. Protocol
d. MAC Address
Answer  Explanation 

ANSWER: Protocol

Explanation:
No explanation is available for this question!


21)   The flush() method of PrintStream class flushes any uncleared buffers in memory

a. True
b. False


Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


22)   In XML which internet languages are markup languages for handheld devices?

a. WAP
b. WML
c. RSS
d. Both A & B
Answer  Explanation 

ANSWER: Both A & B

Explanation:
No explanation is available for this question!


23)   In which application can XML be used for marking up documents for specialized applications, such as e-commerce, scientific documents, Mathematical formula and e-books?

a. Data exchange between computer systems
b. Data storage
c. Specialized publishing
d. None of the above
Answer  Explanation 

ANSWER: Specialized publishing

Explanation:
No explanation is available for this question!


24)   What defines the method by which you can enumerate (obtain one at a time) the elements in a collection of objects?

a. Stack class
b. Bitset class
c. Enumeration interface
d. None of the above
Answer  Explanation 

ANSWER: Enumeration interface

Explanation:
No explanation is available for this question!


25)   Constructor is like a method that is used to initialize the state of an object. It is invoked at the time of object creation

a. True
b. False


Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!