logo

CuriousTab

CuriousTab

Discussion


Home Interview Technology Comments

  • Question
  • Just by seeing the signature of the bean how can you specity whether it is a Statefull of Stateless Session Bean?


  • Correct Answer
  • The create method in a stateless bean cannot have arguments, and can only have a single method called create() While create in Stateful bean can have arguments and could be any method starting with create string eg create(arg1, arg2, ) Although it is not compiler checked but in stateless bean the ejb Passivate() and ejb Active() methods has to be empty as these functions are never called by EJB container As conceptually in stateful session bean we might need to store the clients information hence arguments in createare necessary While in stateless bean we don't hence no arguments are necessary It's intutive isn't intutive isn't I my life I haven't seen such a futuristic server programming tool as EJB 


  • Technology problems


    Search Results


    • 1. Difference between Java Beans & Servlets?
    • Discuss
    • 2. try { int x = Integer.parseInt("two"); } Which could be used to create an appropriate catch block?

    • Options
    • A. ClassCastException
    • B. IllegalStateException
    • C. NumberFormatException
    • D. None
    • Discuss
    • 3. class Hell { public static void main(String[] args) { Integer i = 42; String s = (i<40)?"life":(i>50)?"base":"ball"; System.out.println(s); } }

    • Options
    • A. null
    • B. ball
    • C. base
    • D. None
    • Discuss
    • 4. Which is true?

    • Options
    • A. "X extends Y" is correct if and only if X is a class and Y is an interface
    • B. "X extends Y" is correct if and only if X is a class and Y is an interface
    • C. "X extends Y" is correct if X and Y are either both classes or both interfaces
    • D. "X extends Y" is correct for all combinations of X and Y being classes and/or interfaces
    • Discuss
    • 5. Which of the following is not used for commenting in java?

    • Options
    • A. //
    • B. /* */
    • C. /** */
    • D. /** **/
    • Discuss
    • 6. How are this() and super() used with constructors?
    • Discuss
    • 7. How do you decide when to use HashMap and when to use TreeMap ?
    • Discuss
    • 8. What is the Dictionary class?
    • Discuss
    • 9. What is the common usage of serialization? What exceptions occur during serialization?
    • Discuss
    • 10. What is the purpose of garbage collection in Java, and when is it used ?
    • Discuss


    Comments

    There are no comments.

Enter a new Comment