Multiple choice technology programming languages

Which of the following are true about an enterprise bean according to the EJB 2.0 spec?

  1. A bean cannot use java.net.Socket.

  2. A bean instance variable cannot be declared static and final.

  3. A bean cannot listen on a socket as a server.

  4. A bean cannot use the java.io package.

  5. A bean cannot use this in the body of a class method.

Reveal answer Fill a bubble to check yourself
C,D Correct answer
Explanation

EJB 2.0 spec restricts beans to managed container environments: they cannot act as socket servers (C) because the container manages all network resources, and cannot use java.io (D) to prevent direct file system access. Option A is false - beans can use Sockets (as clients), and B is false - instance variables can be static/final.