Java - 17

1)   An exception is an event, which occurs during the execution of a program that disrupts the normal flow of the program's instructions.

a. True
b. False


Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


2)   Switch is more efficient than nested if or if - else in java.

a. True
b. False


Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


3)   Which is used for reading streams of raw bytes such as image data and for reading streams of characters, consider using FileReader?

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

ANSWER: FileInputStream

Explanation:
No explanation is available for this question!


4)   Which class is used to uncompress the file in the deflate compression format, It provides facility to the other uncompression filters?

a. DeflaterOutputStream class
b. InflaterInputStream class
c. Both A & B
d. None of the above
Answer  Explanation 

ANSWER: InflaterInputStream class

Explanation:
No explanation is available for this question!


5)   Which method is used to change the name of a thread?

a. public String getName()
b. public void setName(String name)
c. public void getName()
d. public String setName(String name)
Answer  Explanation 

ANSWER: public void setName(String name)

Explanation:
No explanation is available for this question!


6)   Which mechanism is used when a thread is paused running in its critical section and another thread is allowed to enter (or lock) in the same critical section to be executed?

a. Inter-thread communication
b. Initial-thread communication
c. Mutual Exclusive
d. None of the above
Answer  Explanation 

ANSWER: Inter-thread communication

Explanation:
No explanation is available for this question!


7)   How many reserved keywords are currently defined in the Java language?

a. 48
b. 49
c. 50
d. 47
Answer  Explanation 

ANSWER: 49

Explanation:
No explanation is available for this question!


8)   Which constructor creates an empty string buffer with the specified capacity as length.

a. StringBuffer()
b. StringBuffer(String str)
c. StringBuffer(int capacity)
d. None of the above
Answer  Explanation 

ANSWER: StringBuffer(int capacity)

Explanation:
No explanation is available for this question!


9)   Which method Drops all changes made since the previous commit/rollback?

a. public void rollback()
b. public void commit()
c. public void close()
d. public Statement createStatement()
Answer  Explanation 

ANSWER: public void rollback()

Explanation:
No explanation is available for this question!


10)   ResultSetMetaData interface is useful because it provides methods to get metadata from the ResultSet object.


a. True
b. False


Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


11)   The performance of the application will be faster if you use PreparedStatement interface because query is compiled only once.

a. True
b. False


Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


12)   The sendRedirect() method of HttpServletResponse interface can be used to redirect response to another resource, it may be servlet, jsp or html file.

a. True
b. False


Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


13)   Which class provides stream to read binary data such as image etc. from the request object?

a. ServltInputStream
b. ServletOutputStream
c. Both A & B
d. None of the above
Answer  Explanation 

ANSWER: ServltInputStream

Explanation:
No explanation is available for this question!


14)   Using mail API we cannot send mail from a servlet.

a. True
b. False


Answer  Explanation 

ANSWER: False

Explanation:
No explanation is available for this question!


15)   Abbreviate the term OGNL?

a. Object-Goal Navigation Language
b. Object- Graph Navigation Language
c. Oriented-Graph Navigation Language
d. None of the above
Answer  Explanation 

ANSWER: Object- Graph Navigation Language

Explanation:
No explanation is available for this question!


16)   Which type of validation we must implement the Validateable interface (or extend ActionSupport class) and provide the implementation of validate method?

a. By Input Validation
b. By Ajax Validation
c. By Custom Validation
d. None of the above
Answer  Explanation 

ANSWER: By Custom Validation

Explanation:
No explanation is available for this question!


17)   Which validates the given string with the specified regular expression,it can be used in password, security key etc.?

a. Regex Validation
b. Url Validation
c. Email Validation
d. RequiredString Validator
Answer  Explanation 

ANSWER: Regex Validation

Explanation:
No explanation is available for this question!


18)   Spring framework provides an difficult way to manage the dependency, It cannot be easily integrated with struts 2 framework.

a. True
b. False


Answer  Explanation 

ANSWER: False

Explanation:
No explanation is available for this question!


19)   Abbreviate the term JMS?

a. Java Message Service
b. Java Monitor Service
c. Java Message Session
d. Java Monitor Session
Answer  Explanation 

ANSWER: Java Message Service

Explanation:
No explanation is available for this question!


20)   A message driven bean is like statefull session bean that encapsulates the business logic and doesn't maintain state.

a. True
b. False


Answer  Explanation 

ANSWER: False

Explanation:
No explanation is available for this question!


21)   EJB QL is a Query Language provided for navigation across a network of enterprise beans and dependent objects defined by means of container managed persistence.

a. True
b. False


Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


22)   Abbreviate the term DGC?

a. Digital Garbage Collection
b. Distributed Garbage Collection
c. Distributed Garbage Connection
d. None of the above
Answer  Explanation 

ANSWER: Distributed Garbage Collection

Explanation:
No explanation is available for this question!


23)   An RMI Server is responsible for _______

a. Creating an instance of the remote object
b. Exporting the remote object
c. Binding the instance of the remote object to the RMI registry
d. All mentioned above
Answer  Explanation 

ANSWER: All mentioned above

Explanation:
No explanation is available for this question!


24)   Java supports RMI, RMI Stands for?

a. Random Method Invocation
b. Remote Memory Interface
c. Remote Method Invocation
d. Random Method Invocation
Answer  Explanation 

ANSWER: Remote Method Invocation

Explanation:
No explanation is available for this question!


25)   Which Error Handling in Java handles runtime errors with exceptions, If an exception is not caught in your JSP or Servlet, Resin will use a special error page to send results back to the browser, Resin uses a default error page unless you explicitly provide an error page yourself?

a. Client Request Time Processing Errors
b. Compilation Time Processing Errors
c. JSP Translation Time Processing Errors
d. None of the above
Answer  Explanation 

ANSWER: Client Request Time Processing Errors

Explanation:
No explanation is available for this question!