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

Need Immediate Help

 
Mahela Wickramasekara
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys

Consider an Enity Bean with a remote client
In the home interface of an entity bean both the create() & findByPrimarykey() methods returns component interface type
then why on earth we don't have to cast & narrow when v use findByPrimarykey() method ,Only when v use create() method v have to narrow & cast the result.
I dont get this thing Pls help me

regards
Mahela (exam date 22nd Dec)
 
B.Sathish
Ranch Hand
Posts: 372
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We don't need to narrow or cast the home.create() or home.findByPrimaryKey() return values. Only stubs coming from look-ups and handles need to be narrowed and then cast
 
Sankar Subbiramaniam
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Following link will help:
When to narrow and when not
 
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!