Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Mock Exam Question

 
Alibabra Sanjie
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Code:
4. public interface PartyHome extends javax.ejb.EJBHome {
5. public Party create(String firstName) throws ...
6. }
Which of the following Exceptions must be included in the throws clause of every create<METHOD> in the following code fragment? [Check all correct answers]

1. javax.ejb.FinderException.
2. javax.ejb.CreateException.
3. java.rmi.RemoteException.
4. java.rmi.NoSuchObjectException.
5. javax.ejb.NoSuchObjectLocalException.

The answer from the mock exam is 2 and 3
But I have problem with the 3. 3 should not be the answer because the question has the key word "must", but if I define a local home interface, I don't have to throws RemoteException.
Any comments?
 
Dale Seng
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The wording can stand as-is because the scenario you define (a local home) would be apparent from the code segment provided. I'll leave it to you to discover what would be different in the code for a local interface.
--Dale--
 
Alibabra Sanjie
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, that's my mistake. "EJBHome" imply that is a remote home interface. So 2 and 3 are the correct answer.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic