Java Test Questions Set 3

1)   In Method overriding a subclass in a different package can only override the non-final methods declared public or protected

a. True
b. False


Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


2)   The following two rules are defined by?
      1. The parameters may differ in their type or number, or in both.
      2. They may have the same or different return types.


a. Method overloading
b. Method overriding
c. Constructor overloading
d. None of the above
Answer  Explanation 

ANSWER: Method overloading

Explanation:
No explanation is available for this question!


3)   Which allows you to migrate your implementations over time without breaking the code that depends on the public interface of your classes?

a. Polymorphism
b. Inheritance
c. Encapsulation
d. Both A & B
Answer  Explanation 

ANSWER: Encapsulation

Explanation:
No explanation is available for this question!


4)   Which is used for writing data to a file in file handling?

a. FileInputStream
b. FileOutputStream
c. Both A & B
d. None of the above
Answer  Explanation 

ANSWER: FileOutputStream

Explanation:
No explanation is available for this question!


5)   In which state is the thread after invocation of start() method, but the thread Scheduler has not selected it to be the running thread?

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

ANSWER: Runnable

Explanation:
No explanation is available for this question!


6)   Which package is used for analyzing code during run time?

a. java.lang.reflect
b. java.awt
c. java.io
d. java.applet
Answer  Explanation 

ANSWER: java.lang.reflect

Explanation:
No explanation is available for this question!


7)   The JDK forms an extended subset of a software development kit (SDK)

a. True
b. False


Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


8)   Which mechanism is provided to handle the runtime errors so that normal flow of the application can be maintained?

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

ANSWER: Exception Handling

Explanation:
No explanation is available for this question!


9)   Constructor does not perform other tasks instead of initialization

a. True
b. False


Answer  Explanation 

ANSWER: False

Explanation:
No explanation is available for this question!


10)   In java, Method Overloading is possible by changing the return type of the method

a. True
b. False


Answer  Explanation 

ANSWER: False

Explanation:
No explanation is available for this question!


11)   Garbage collection only occurs sporadically during the execution of your program

a. True
b. False


Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


12)   Which driver uses ODBC driver to connect to the database?

a. JDBC-ODBC bridge driver
b. Native - API driver
c. Network Protocol driver
d. Thin driver
Answer  Explanation 

ANSWER: JDBC-ODBC bridge driver

Explanation:
No explanation is available for this question!


13)   In HTTP Request method Get request is secured because data is exposed in URL bar

a. True
b. False


Answer  Explanation 

ANSWER: False

Explanation:
No explanation is available for this question!


14)   How many techniques are used in Session Tracking?

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

ANSWER: 4

Explanation:
No explanation is available for this question!


15)   Which of these simplifies an Object Relational Mapping tool?

a. Data creation
b. Data manipulation
c. Data access
d. All mentioned above
Answer  Explanation 

ANSWER: All mentioned above

Explanation:
No explanation is available for this question!


16)   The struts 2 framework is used to develop MVC-based web application

a. True
b. False


Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


17)   Which middleware services are provided by EJB?

a. Security
b. Transaction Management
c. Both A & B
d. None of the above
Answer  Explanation 

ANSWER: Both A & B

Explanation:
No explanation is available for this question!


18)   In RMI which layer defines and supports the invocation semantics of the RMI connection and this layer maintains the session during the method call?

a. The Stub & Skeleton Layer
b. The Application Layer
c. The Remote Reference Layer
d. The Transport Layer
Answer  Explanation 

ANSWER: The Remote Reference Layer

Explanation:
No explanation is available for this question!


19)   A JSP page consists of which tags?

a. HTML tags
b. JSP tags
c. Both A & B
d. None of the above
Answer  Explanation 

ANSWER: Both A & B

Explanation:
No explanation is available for this question!


20)   The JDBC API is what allows access to a data source from a Java middle tier

a. True
b. False


Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


21)   Which is invoked after the init() method or browser is maximized?

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

ANSWER: public void start()

Explanation:
No explanation is available for this question!


22)   Which class provides many methods for graphics programming?

a. java.awt
b. java.Graphics
c. java.awt.Graphics
d. None of the above
Answer  Explanation 

ANSWER: java.awt.Graphics

Explanation:
No explanation is available for this question!


23)   StringTokenizer implements the Enumeration interface

a. True
b. False


Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


24)   What does the java.net.InetAddress class represent?

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

ANSWER: IP Address

Explanation:
No explanation is available for this question!


25)   Datagram is basically an information but there is no guarantee of its content, arrival or arrival time.

a. True
b. False


Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!