1.
When the ejbRemove method encounters a system problem ,it should throw_________
Correct Answer
C. Java.ejb.RemoveException
Explanation
When the ejbRemove method encounters a system problem, it should throw java.ejb.RemoveException. This exception is specifically designed for situations where there is an issue with removing an entity bean. It allows the application to handle the exception appropriately and take necessary actions, such as logging the error or notifying the user. The other options, javax.ejb.DuplicateKeyException, java.ejb.EJBException, and javax.ejb.NoSuchEntityException, are not suitable for this scenario as they are not specifically related to the removal of an entity bean.
2.
Which of these operators can skip evaluating right hand operand?
Correct Answer
C. &&
Explanation
The operator && can skip evaluating the right hand operand if the left hand operand evaluates to false. This is known as short-circuit evaluation. If the left hand operand is false, the overall expression will always be false regardless of the value of the right hand operand, so there is no need to evaluate it. This can be useful in situations where evaluating the right hand operand would be time-consuming or could cause an error.
3.
___________ is a block of java code in JSP that is used define class-wide variables and methods in the generated class file
Correct Answer
A. expression
4.
3. Which of the following is not an implicit object ?
Correct Answer
A. Date
Explanation
The correct answer is "date". In JavaServer Pages (JSP), implicit objects are predefined variables that can be accessed without explicitly declaring them. The "date" object is not one of the implicit objects in JSP. The other options - "page context", "request", and "out" - are all implicit objects that provide access to various functionalities and information within a JSP page.
5.
4. An Enterprise JavaBeans can be deployed in _______
Correct Answer
A. Web spHere
Explanation
An Enterprise JavaBean (EJB) can be deployed in WebSphere, WebLogic, and any J2EE server. These are all popular platforms that support the deployment of EJBs. Therefore, the correct answer is "All of the above."
6.
Mapping files (*.hbm.xml) is used __________
Correct Answer
A. To configure the hibernate services (connection username, connection password, dialect etc)
Explanation
Mapping files (*.hbm.xml) are used to configure the Hibernate services, such as the connection username, connection password, and dialect. These mapping files are used to define the mapping between persistent objects and a relational database. Therefore, the correct answer is to configure the Hibernate services (connection username, connection password, dialect etc).
7.
To determine the behaviour of the beans in an application , we make use of
Correct Answer
B. Java.beans.SimpleBeanInfo
Explanation
To determine the behavior of the beans in an application, we make use of Java.beans.SimpleBeanInfo. This class is used to provide information about a bean's properties, methods, and events. It allows us to customize the appearance and behavior of the bean at design time. By extending the SimpleBeanInfo class and overriding its methods, we can specify the properties, methods, and events that should be displayed in a bean's property editor or inspector. This information is crucial for understanding and utilizing the functionalities of the beans in the application.
8.
What is the output of relational operators?
Correct Answer
C. Boolean
Explanation
Relational operators compare two values and return a boolean value indicating whether the comparison is true or false. Therefore, the output of relational operators is a boolean.
9.
Name the element within the tag element that defines the tag class that implements the functionality of tag
Correct Answer
A. Tag-name
Explanation
The correct answer is "tag-name". This element within the tag element is used to define the name of the tag class that implements the functionality of the tag. It is responsible for specifying the unique identifier for the tag class, allowing it to be referenced and utilized within the code.
10.
Consider the following HTML page code: < html > < body > < a href='/servlet/HelloServlet' >POST< /a > < /body >< /html > Which method of HelloServIet will be invoked when the hyperlink is clicked?
Correct Answer
A. ServicePost
Explanation
The correct method that will be invoked when the hyperlink is clicked is "servicePost".