• Post Reply Bookmark Topic Watch Topic
  • New Topic

Enthuware Question- looks like wrong answer

 
Amandeep Singh
Ranch Hand
Posts: 850
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Consider the following code snippet appearing in a client of an enterprise JavaBean. Assuming that line 11 always prints the sum of all integers passed in the add() calls by this client, what can be said about the client and the bean?



1) This code is bugy because it assumes that it is the sole user of the bean.

2) This code is bugy because it is reusing the bean remote reference.

3) This is a valid client code and the bean is an EJB 2.0 Entity bean.

4) This is a valid client code and the bean is a stateful session bean.

5) This is a valid client code and the bean is a stateless session bean.

the correct answer given is 4.

to me it seems neither of them is the correct answer because
this line of code


should do type casting and it didn't did. so this is a buggy code.

it should be like this-




Please advise.
 
Paul Anilprem
Enthuware Software Support
Ranch Hand
Posts: 3893
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
YOu are right. The cast is missing. Should be fixed.

thank you,
Paul.
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
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!