Advanced Java Practice Test Quiz

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By Tutuagyekum
T
Tutuagyekum
Community Contributor
Quizzes Created: 54 | Total Attempts: 21,308
Questions: 10 | Attempts: 1,865

SettingsSettingsSettings
Advanced Java Practice Test Quiz - Quiz

Advanced Java, as the name implies, is not easy! It is very advanced and complicated. Much more than basic Java. But it makes computing much easier! Can be used on any device and anywhere.


Questions and Answers
  • 1. 

     When the ejbRemove method encounters a system problem ,it should throw_________

    • A.

      Javax.ejb.DuplicateKeyException 

    • B.

      Java.ejb.EJBException 

    • C.

      Java.ejb.RemoveException 

    • D.

       javax.ejb.NoSuchEntityException 

    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.

    Rate this question:

  • 2. 

    Which of these operators can skip evaluating right hand operand?

    • A.

      !

    • B.

      &

    • C.

      &&

    • D.

      (*)

    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.

    Rate this question:

  • 3. 

     ___________ is a block of java code in JSP that is used define class-wide variables and methods in the generated class file

    • A.

       expression 

    • B.

       declarations 

    • C.

       element 

    • D.

      Scriplets 

    Correct Answer
    A.  expression 
  • 4. 

    3. Which of the following is not an implicit object ?

    • A.

      Date 

    • B.

       page context 

    • C.

       request 

    • D.

      Out 

    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.

    Rate this question:

  • 5. 

    4. An Enterprise JavaBeans can be deployed in _______

    • A.

       Web sphere 

    • B.

      Weblogic 

    • C.

       J2EE server 

    • D.

       All of the above

    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."

    Rate this question:

  • 6. 

    Mapping files (*.hbm.xml) is used __________

    • A.

      To configure the hibernate services (connection username, connection password, dialect etc)

    • B.

      To map persistent objects to a relational database 

    • C.

      To configure the hibernate services (connection driver class, connection URL) 

    • D.

      All the above 

    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).

    Rate this question:

  • 7. 

    To determine the behaviour of the beans in an application , we make use of

    • A.

      Java.awt.* 

    • B.

       Java.beans.SimpleBeanInfo 

    • C.

       Java.beans.Introspector 

    • D.

       None of the above 

    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.

    Rate this question:

  • 8. 

     What is the output of relational operators?

    • A.

      Double

    • B.

      Integer

    • C.

      Boolean

    • D.

      Characters

    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.

    Rate this question:

  • 9. 

    Name the element within the tag element that defines the tag class that implements the functionality of tag

    • A.

      Tag-name 

    • B.

      Tag 

    • C.

      Tag-class 

    • D.

      Tag-uri 

    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.

    Rate this question:

  • 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?

    • A.

      ServicePost 

    • B.

      DoPost 

    • C.

      DoHref 

    • D.

      DoGet 

    Correct Answer
    A. ServicePost 
    Explanation
    The correct method that will be invoked when the hyperlink is clicked is "servicePost".

    Rate this question:

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 22, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Apr 13, 2019
    Quiz Created by
    Tutuagyekum
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.