• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Jdiscuss mock exam - question

 
Sankar Subbiramaniam
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Question:
Which of the following are true regarding the implementation of an Message Driven Bean?
Select 3 correct options.

(A) The class must have, directly or indirectly, a non abstract onMessage method.

(B) It cannot implement ejbRemove method.

(C) It may implement finalize() method.

(D) It must implement setMessageDrivenContext() method.

(E) It may implement overloaded ejbCreate() methods


I could see only 2 correct options: A & D.

Am i missing some trick ?
 
Devender Thareja
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The third option should be "C".

Every java Object have a finalize() method and I don't see a reason why it can not overridden in this situation.
 
Sankar Subbiramaniam
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please refer to spec page 324, first line states: "The class must not define the finalize() method."
So option C is not correct.
 
Devender Thareja
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmm..
I haven't read the spec yet.
In HF EJB, only rule regarding ejbCreate is that "You must have a single, no-arg ejbCreate(). It doesn't say that other create methods are not allowed. But then even if overloaded create is allowed, it wouldn't server any purpose and it wouldn't be used. Does that make option E correct?
I will try it when I get a chance.
It defnitely must implement ejbRemove() method.
May be the question is wrong?
 
Devender Thareja
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look what I found:
http://www.coderanch.com/t/160994/java-EJB-SCBCD/certification/Overload-ejbCreate-MDB
 
B.Sathish
Ranch Hand
Posts: 372
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't worry guys, the exam questions will be straight-forward. You won't get confusing questions like these. cheer up
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic