File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Mock Exam Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Mock Exam Question" Watch "Mock Exam Question" New topic

Mock Exam Question

Alibabra Sanjie
Ranch Hand

Joined: Feb 09, 2004
Posts: 147
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

Joined: Mar 22, 2004
Posts: 275
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.
Alibabra Sanjie
Ranch Hand

Joined: Feb 09, 2004
Posts: 147
Yes, that's my mistake. "EJBHome" imply that is a remote home interface. So 2 and 3 are the correct answer.
I agree. Here's the link:
subject: Mock Exam Question
It's not a secret anymore!