Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

mock question

 
Prashant Neginahal
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which exception is thrown when remote client tries to call remove() on a bean thats already been removed?

1) NoSuchObjectException
2) RemoteExcption
3) IlligalStateException
4) NoSuchEntityException

Whether both (1) and (2) are correct, or ONLY (1) is correct?

Thanks,
Prashant
 
sawan parihar
Ranch Hand
Posts: 250
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the question asks about selecting one option then first one is correct.

On the other hand one and two both are correct.

1) NoSuchObjectException
2) RemoteExcption

The container doesn't guarantee that the client will get NoSuchObjectException a remote client may get RemoteException.

Hope it helps.
 
Miki Muzsi
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Parshant, i had the same question: see here

Miki
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!