Java and J2EE Programming Quiz

A quiz covering Java programming concepts including multithreading, operators, layout managers, and J2EE enterprise application topics like entity beans, session beans, and multitiered applications.

16 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

What advantage does an entity bean have over a session bean?

  1. Entity bean data survives crashes.
  2. An entity bean represents non-persistent data.
  3. It creates its own JAR file during deployment.
  4. You get authentication code without having to write any.
Question 2 Multiple Choice (Single Answer)

When do you use a session bean?

  1. When you want to be certain your application data persists between program invocations, even in the event of a crash.
  2. If you need to initiate a database transaction.
  3. To process transient data that can be re-created in the event of a crash.
  4. To keep people who do not know how to program from accidentally changing important logic code
Question 3 Multiple Choice (Single Answer)

Why would you design a J2EE application so user data is entered by way of a JavaServer Page and managed by an underlying JavaBeans class?

  1. To make the user interface more interesting.
  2. To simplify application deployment.
  3. To prevent malicious programs from gaining access to sensitive information on your database server.
  4. To make the application much easier to update, maintain, and manage.
Question 4 Multiple Choice (Single Answer)

Why is XML a good way to transfer text-based data from one program or tool to another?

  1. XML imposes important limitations on the receiving program or tool.
  2. The receiving program or tool can use the XML tagging information to determine how to best handle the incoming data.
  3. XML tags offer an extra level of security
  4. XML tags specify to the receiving program or tool exactly how to format and display the data.
Question 5 Multiple Choice (Single Answer)

What part of the J2EE platform handles data storage and retrieval on behalf of a container-managed entity bean?

  1. The thin client.
  2. Deployment descriptors.
  3. The JAR file.
  4. The bean's container
Question 6 Multiple Choice (Single Answer)

What is bean-managed persistence?

  1. When you implement entity or session bean methods to use SQL commands you provide.
  2. When the bean's container handles data storage and retrieval.
  3. When the J2EE server is never shut down
  4. When changes to database data are lost during a crash.
Question 7 Multiple Choice (Single Answer)

How are life cycle methods called?

  1. By thin clients.
  2. By calls to the database.
  3. By the J2EE server.
  4. By the bean's container.
Question 8 Multiple Choice (Single Answer)

In a multitiered application, which tier is the browser in?

  1. First tier.
  2. Second tier.
  3. Third tier.
  4. Fourth tier
Question 9 Multiple Choice (Single Answer)

What is the output of the program?

  1. 13
  2. 15
  3. 0
  4. Compiler error
Question 10 Multiple Choice (Single Answer)

which is the first web browser developed in java

  1. internet explorer
  2. Netscape Navigator
  3. Hotjava
  4. Opera
Question 11 Multiple Choice (Single Answer)

what is the output of the following program

  1. 0
  2. -1
  3. -2
  4. compiler error
Question 12 Multiple Choice (Single Answer)

Which of the following java doesnt support?

  1. signed number
  2. unsigned number
  3. signed right shift
  4. unsigned left shift
Question 13 Multiple Choice (Single Answer)

what does the symbol means in java?

  1. logical NOT
  2. logical OR
  3. logical AND
  4. logical XOR
Question 14 Multiple Choice (Single Answer)

which symbol denotes current working directory?

  1. . (dot)
  2. !
  3. %
  4. *
Question 15 Multiple Choice (Single Answer)

­­_______ is the ability to do multiple tasks at the same time

  1. multithreading
  2. multitasking
  3. multiprograming
  4. multiprocessing
Question 16 Multiple Choice (Single Answer)

_________ defines how the component will be arranged in the container

  1. layout manager
  2. outline manager
  3. component design
  4. component manager