Java - 18

1)   Which object of HttpSession can be used to view and manipulate information about a session?

a. session identifier
b. creation time
c. last accessed time
d. All mentioned above
Answer  Explanation 

ANSWER: All mentioned above

Explanation:
No explanation is available for this question!


2)     Connection Pooling Class manages no of user requests for connections to improve the performance.

a. True
b. False


Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


3)   Which case of a session bean obtains the UserTransaction object via the EJBContext using the getUserTransaction() method in EJB transaction management?

a. Bean-managed transactions
b. Container-managed transactions
c. Both A & B
d. None of the above
Answer  Explanation 

ANSWER: Bean-managed transactions

Explanation:
No explanation is available for this question!


4)   Which services are provided to EJB components by the EJB container?


a. Transaction support
b. Persistence support
c. Naming support
d. All mentioned above
Answer  Explanation 

ANSWER: All mentioned above

Explanation:
No explanation is available for this question!


5)   Which is an object, acts as a gateway for the client side, all the outgoing requests are routed through it and it resides at the client side and represents the remote object?


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

ANSWER: Stub

Explanation:
No explanation is available for this question!


6)   In RMI Architecture which layer Intercepts method calls made by the client/redirects these calls to a remote RMI service?

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

ANSWER: Stub & Skeleton Layer

Explanation:
No explanation is available for this question!


7)   Which attribute specifies a JSP page that should process any exceptions thrown but not caught in the current page?

a. The ErrorPage Attribute
b. The IsErrorPage Attribute
c. Both A & B
d. None of the above
Answer  Explanation 

ANSWER: The ErrorPage Attribute

Explanation:
No explanation is available for this question!


8)   What technique is used for the authentication mechanism in the servlet specification?

a. Role Based Authentication
b. Form Based Authentication
c. Both A & B
d. None of the above
Answer  Explanation 

ANSWER: Role Based Authentication

Explanation:
No explanation is available for this question!


9)   Abbreviate the term UDA?

a. Unified Data Access
b. Universal Data Access
c. Universal Digital Access
d. Uniform Data Access
Answer  Explanation 

ANSWER: Universal Data Access

Explanation:
No explanation is available for this question!


10)   How many Result sets available with the JDBC 2.0 core API?

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

ANSWER: 3

Explanation:
No explanation is available for this question!


11)   Which method is used for retrieving streams of both ASCII and Unicode characters is new in the JDBC 2.0 core API?

a. getCharacterStream
b. getBinaryStream
c. getAsciiStream
d. getUnicodeStream
Answer  Explanation 

ANSWER: getCharacterStream

Explanation:
No explanation is available for this question!


12)   Which JDBC type represents a "single precision" floating point number that supports seven digits of mantissa?

a. REAL
b. DOUBLE
c. FLOAT
d. INTEGER
Answer  Explanation 

ANSWER: REAL

Explanation:
No explanation is available for this question!


13)   The JDBC API has always supported persistent storage of objects defined in the Java programming language through the methods getObject and setObject.

a. True
b. False


Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


14)    In order to transfer data between a database and an application written in the Java programming language, the JDBC API provides which of these methods?


a. Methods on the ResultSet class for retrieving SQL SELECT results as Java types.
b. Methods on the PreparedStatement class for sending Java types as SQL statement parameters.
c. Methods on the CallableStatement class for retrieving SQL OUT parameters as Java types.
d. All mentioned above
Answer  Explanation 

ANSWER: All mentioned above

Explanation:
No explanation is available for this question!


15)   Which are the common security restrictions in applets?

a. Applets can't load libraries or define native methods
b. An applet can't read every system property
c. Applets can play sounds
d. Both A & B
Answer  Explanation 

ANSWER: Both A & B

Explanation:
No explanation is available for this question!


16)   An applet can play an audio file represented by the AudioClip interface in the java, applet package Causes the audio clip to replay continually in which method?


a. public void play()
b. public void loop()
c. public void stop()
d. None of the above
Answer  Explanation 

ANSWER: public void loop()

Explanation:
No explanation is available for this question!


17)   The following example shows the creation of a
import java.applet.*;
import java.awt.*;

public class Main extends Applet{
public void paint(Graphics g){
g.drawString("Welcome in Java Applet.",40,20);
}
}


a. Banner using Applet
b. Basic Applet
c. Display clock
d. None of the above
Answer  Explanation 

ANSWER: Basic Applet

Explanation:
No explanation is available for this question!


18)   In Servlet Terminology what provides runtime environment for JavaEE (j2ee) applications. It performs many operations that are given below:

1. Life Cycle Management
2. Multithreaded support
3. Object Pooling
4. Security etc.


a. Server
b. Webserver
c. Container
d. Application Server
Answer  Explanation 

ANSWER: Container

Explanation:
No explanation is available for this question!


19)   These two ways are used to create a Frame

By creating the object of Frame class (association)
By extending Frame class (inheritance)


a. True
b. False


Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


20)   Which is the container that doesn't contain title bar and MenuBars but it can have other components like button, textfield etc?

a. Window
b. Frame
c. Panel
d. Container
Answer  Explanation 

ANSWER: Panel

Explanation:
No explanation is available for this question!


21)   Implement the Listener interface and overrides its methods is required to perform in event handling.


a. True
b. False


Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


22)   Where are the following four methods commonly used?

1) public void add(Component c)
2) public void setSize(int width,int height)
3) public void setLayout(LayoutManager m)
4) public void setVisible(boolean)


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

ANSWER: Component class

Explanation:
No explanation is available for this question!


23)   Which method when implemented must return true while there are still more elements to extract, and false when all the elements have been enumerated?


a. Object nextElement( )
b. boolean hasMoreElements( )
c. Both A & B
d. None of the above
Answer  Explanation 

ANSWER: boolean hasMoreElements( )

Explanation:
No explanation is available for this question!


24)   The following Syntax is used for?

class Subclass-name extends Superclass-name
{
//methods and fields
}


a. Polymorphism
b. Encapsulation
c. Inheritance
d. None of the above
Answer  Explanation 

ANSWER: Inheritance

Explanation:
No explanation is available for this question!


25)   From the following statements which is a disadvantage of an java array?

a. An array can hold primitive types data
b. An array has its size that is known as array length
c. An array knows only its type that it contains. Array type is checked at the compile-time
d. An array holds only one type of data
Answer  Explanation 

ANSWER: An array holds only one type of data

Explanation:
No explanation is available for this question!


26)   The PipedInputStream and PipedOutputStream classes can be used to read and write data simultaneously.

a. True
b. False


Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


27)   Which method returns the interrupted flag after that it sets the flag to false if it is true?

a. isInterrupted()
b. static interrupted()
c. non static interrupted()
d. Both A & C
Answer  Explanation 

ANSWER: static interrupted()

Explanation:
No explanation is available for this question!


28)   Unchecked exceptions are checked at compile-time rather they are checked at runtime.

a. True
b. False


Answer  Explanation 

ANSWER: False

Explanation:
No explanation is available for this question!


29)   Struts supports which of these model components?

a. JavaBeans
b. EJB
c. CORBA
d. JDO
e. All Mentioned above
Answer  Explanation 

ANSWER: All Mentioned above

Explanation:
No explanation is available for this question!


30)   Abbreviate the term POJO?

a. Plain Old Java Object
b. Performance Old Java Object
c. Performance Optimize Java Object
d. None of the above
Answer  Explanation 

ANSWER: Plain Old Java Object

Explanation:
No explanation is available for this question!