Java Test Questions Set 5

1)   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!


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


3)   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!


4)   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!


5)   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!


6)   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!


7)   The following exceptions:

NullPointerException,
ArrayIndexOutOfBoundsException,
ArithmeticException,
NumberFormatException

are seen in _______


a. Checked exception
b. Unchecked exception
c. Both A & B
d. None of the above
Answer  Explanation 

ANSWER: Unchecked exception

Explanation:
No explanation is available for this question!


8)   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!


9)   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!


10)   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!


11)   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!


12)   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!


13)   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!


14)   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!


15)   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!


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


17)   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!


18)   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!


19)   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!


20)   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!


21)   Void is not a wrapper class

a. True
b. False


Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


22)   Give the abbrevation of BSD.

a. Berkeley Software Distribution
b. Berkeley Socket Distribution
c. Berkeley System Distribution
d. None of the above
Answer  Explanation 

ANSWER: Berkeley Software Distribution

Explanation:
No explanation is available for this question!


23)   The DatagramSocket and DatagramPacket classes are not used for connection-less socket programming.

a. True
b. False


Answer  Explanation 

ANSWER: False

Explanation:
No explanation is available for this question!


24)   What is XML used to simplify?

a. Data storage
b. Data sharing
c. Both A & B
d. None of the above
Answer  Explanation 

ANSWER: Both A & B

Explanation:
No explanation is available for this question!


25)   Which Characters are illegal in XML elements?

a. " < "
b. "&"
c. Both A & B
d. None of the above
Answer  Explanation 

ANSWER: Both A & B

Explanation:
No explanation is available for this question!