You are on page 1of 8

EJB Test Breakdown:

1. What will be returned by the method ejbCreate() CMP bean? You answered: Remote Object Incorrect Correct answer: null 2. Which of the following is not a life-cycle method for a Stateful Session Bean? You answered: Post Activation Incorrect Correct answer: Pre Construction 3. Which of the following is true ? You answered: Multiple users can access Stateful session beans at the same time Incorrect Correct answer: Preserving of any state across method calls does not performed by Stateless session beans 4. Stateful Session beans contain You answered: Remote Interface Incorrect Correct answer: All of the above 5. Which of the following regarding business methods in a bean class is incorrect? Correct 6. Choose the incorrect statement from the following about Home methods in a bean class for CMP (Container Managed Persistence). You answered: Relationships must not be accessed by the method Incorrect Correct answer: The throws clause of the method may include the java.rmi.RemoteException. 7. Given the following code in a stateful session bean business method; try { Socket skt = new Socket(x,y); } catch (Exception ex) { ex.printStackTrace(); } assuming that x and y are the port and IP addresses respectively of a running service, which is running on the same server, which of the following is correct? You answered: Failure in Compilation Incorrect Correct answer: Indeterminate. The code is not guaranteed to be ported to all EJB 2.0 container, though it may deploy. 8. Which of the following is true about EJB transactions?

You answered: Bean-managed transaction demarcation must not be used in Message-driven beans Incorrect Correct answer: Bean-managed transaction demarcation must not be used in Entity beans 9. Which of the following are guaranteed capabilities of EJB 2.0? You answered: Run-as security identity functionality. Incorrect Correct answer: Both A and B 10. From the following APIs, which API does NOT guarantees to be supported by EJB 2.0 containers? Correct 11. Which two of the following is responsible to creates ejb-jar files? 1. The bean provider. 2. The application assembler. 3. The deployer. 4. The system administrator. Correct 12. Which two of the following must be included in every ejb-jar file? 1. Stubs for the EJBHome and EJBObject interface. 2. The JAR Manifest file. 3. A deployment descriptor. 4. The JNDI context. 5. The EJB's home interface. You answered: 2 and 5 Incorrect Correct answer: 3 and 5 13. Which statement about session beans is true? Correct 14. Which of the following can be directly invoked by the client? You answered: ejbPassivate Incorrect Correct answer: business methods 15. Which is the method available in SessionContext interface? You answered: getUserTransaction() Incorrect Correct answer: setSessionCotext() 16. Which statements about a session bean class are true? You answered: Their business methods can be 'private' Incorrect

Correct answer: The ejbCreate() method must not be a final method 17. Upon invoking getRollbackOnly() method by a business method in an entity bean, which transaction attribute settings will lead the ejb container to throw an exception? You answered: Required Incorrect Correct answer: Never 18. When a session bean has container-managed demarcation value of 'Supports', which three methods run in an unspecified transaction context? 1. ejbActivate 2. getRollbackOnly 3. getUserTransaction 4. ejbRemove 5. afterBegin 6. afterCompletion You answered: 2,5,6 Incorrect Correct answer: 1,4,6 19. EJB systems performance tuning is the responsibility of You answered: Application Assembler Incorrect Correct answer: EJB Deployer 20. The EJB Transaction Attribute that ensures the method call that always takes place in a transaction, either client started or container started are Correct

ava Test Breakdown:


1. What is the meaning of the return data type void? Correct 2. A lower precision can be assigned to a higher precision value in Java. For example a byte type data can be assigned to int type. Correct 3. Which of the following statements about the Java language is true? You answered: Java supports only procedural approach towards programming. Incorrect Correct answer: Both procedural and OOP are supported in Java. 4. Which of the following statements is false about objects? You answered: Objects can access both static and instance data Incorrect

Correct answer: Objects do not permit encapsulation 5. Which methods can access to private attributes of a class? You answered: Only instances of the same class Incorrect Correct answer: Only methods those defined in the same class 6. What is an aggregate object? Correct 7. Assume that File is an abstract class and has toFile() method. ImageFile and BinaryFile are concrete classes of the abstract class File. Also, assume that the method toFile() is implemented in both Binary File and Image File. A File references an ImageFile object in memory and the toFile method is called, which implementation method will be called? You answered: Both File and Binary Files Incorrect Correct answer: Image File 8. A class can have many methods with the same name as long as the number of parameters or type of parameters is different. This OOP concept is known as You answered: Method Labeling Incorrect Correct answer: Method Overloading 9. Which of the following is considered as a blue print that defines the variables and methods common to all of its objects of a specific kind? You answered: Real data types Incorrect Correct answer: Class 10. What are the two parts of a value of type double? You answered: Mode, Numerator Incorrect Correct answer: Significant Digits, Exponent 11. After the following code fragment, what is the value in fname? String str; int fname; str = "Foolish boy."; fname = str.indexOf("fool"); You answered: 2 Incorrect Correct answer: -1 12. What is the value of number after the following code fragment execution?

int number = 0; int number2 = 12 while (number < number2) { number = number + 1; } Correct 13. Given the following code snippet; int salaries[]; int index = 0; salaries = new int salaries[4]; while (index < 4) { salaries[index] = 10000; index++; } What is the value of salaries [3]? You answered: 50000 Incorrect Correct answer: 10000 14. Which of the following is not a return type? You answered: Button Incorrect Correct answer: public 15. If result = 2 + 3 * 5, what is the value and type of result variable? You answered: 25, byte Incorrect Correct answer: 17, int 16. What is the data type for the number 9.6352? You answered: Double Incorrect Correct answer: double 17. Assume that the value 3929.92 is of type float. How to assign this value after declaring the variable interest of type float? Correct 18. Which of the following statements is true? Correct 19. How many numeric data types are supported in Java? You answered: 8 Incorrect Correct answer: 6

20. Which of the following statements declare class Sample to belong to the payroll.admindept package? Correct 21. The class java.lang.Exception is You answered: serializable Incorrect Correct answer: extends Throwable 22. Which of the following statements is true? You answered: An exception can be thrown by throws keyword explicitly. Incorrect Correct answer: An exception can be thrown by throw keyword explicitly. 23. All the wrapper classes (Integer, Boolean, Float, Short, Long, Double and Character) in java Correct 24. The code snippet if( "Welcome".trim() == "Welcome".trim() ) System.out.println("Equal"); else System.out.println("Not Equal"); will You answered: compile and display Not Equal Incorrect Correct answer: cause a compiler error 25. Consider the following code snippet. What will be assigned to the variable fourthChar, if the code is executed? String str = new String(Java); char fourthChar = str.charAt(4); You answered: null characater Incorrect Correct answer: throws StringIndexOutofBoundsException 26. Which of the following statements is preferred to create a string "Welcome to Java Programming"? You answered: String str; str = new String (Welcome to Java Programming ) Incorrect Correct answer: String str = Welcome to Java Programming 27. Which of the following statements is true? You answered: class ClassTwo extends ClassOne means ClassOne is a subclass Incorrect Correct answer: A super class is a sub set of a sub class

28. What kind of thread is the Garbage collector thread is? You answered: None of the above Incorrect Correct answer: Daemon thread 29. When a thread terminates its processing, into what state that thread enters? You answered: Waiting state Incorrect Correct answer: Dead state 30. Which statement is true? You answered: Vector is a subclass of Stack Incorrect Correct answer: HashTable is a sub class of Dictionary 31. Which of these statements is true? You answered: WeakHashMap extends HashMap Incorrect Correct answer: HashSet extends AbstractSet 32. Which of the following is synchronized? Correct 33. Select all the true statements from the following. Correct 34. Which of the methods should be implemented if any class implements the Runnable interface? You answered: wait() Incorrect Correct answer: run() 35. A thread which has invoked wait() method of an object, still owns the lock of the object. Is this statement true or false? Correct 36. Which of the following is not a method of the Thread class. You answered: public final int getPriority() Incorrect Correct answer: public void exit() 37. To execute the threads one after another You answered: None of the above Incorrect Correct answer: the keyword synchronizable is used 38. The object of DataInputStream is used to You answered: All of the above

Incorrect Correct answer: To covert binary stream into character stream 39. DataInputStream is an example of You answered: I/O stream Incorrect Correct answer: Filtered stream

You might also like