Java EE Enterprise Application

 40 Minutes
 20 Questions


This test is designed to assess a candidate's knowledge of Java EE Enterprise Application technologies, including Enterprise JavaBeans (EJB), Java Persistence API (JPA), and Java Transaction API (JTA). The test will cover topics such as the purpose and use of each technology, their differences and similarities, and how they interact with each other. The test will also include questions on best practices for developing applications using these technologies.


Example Question:

Multiple-Choice
Your application has a calculator stateless bean according to the following definition:
@Stateless
@Remote
public class CalculatorBean implements CalculatorRemote {
public float add (int a, int b) {
return a + b;
}
public float subtract (int a, int b) {
return a - b;
}
}
// Remote Interface
@Remote
public interface CalculatorRemote {
public float add (int a, int b) ;
public float subtract (int a, int b);
}
In-order to use the calculator bean from a client application, which code line should be set instead of the "missing-line" below ?
public static void calculate(int a,int b,String jndiName) {
try {
Properties env = new Properties();
env.load(ClassLoader.getSystemResourceAsStream("jndi.properties"));
Context ic = new InitialContext(env);
// missing line
System.out.println(cal.add(a, b));
} catch (Exception ex) {
ex.printStackTrace();
}
}