• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

demo exam question

 
arunij katiliyar
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Identify all correct requirements for a CMP entity bean class? [Check all correct answers]


1 The class must be defined as public.
2 The class must define a public constructor that takes no arguments.
3 The class must not be defined as abstract.
4 The class must define the finalize() method.
5 The class must implement, directly or indirectly, the javax.ejb.EntityBean interface.



The correct answers are 1 2 and 5 .

why should 2 be correct? . In the enterprise bean we dont declare a zero args public constructor explictly .


Arun
 
ravi janap
Ranch Hand
Posts: 389
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

The public constructor with no arguments is used by the container to create a newInstance of the bean.

Thanks

-- Ravi
 
arunij katiliyar
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The doubt is why is there an emphasis in option 2. I had never declared a zero args constructor for an ejb . I think option 2 should be rephrased.

The class "must" define a public constructor that takes no arguments
 
ravi janap
Ranch Hand
Posts: 389
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This has what the specification to say

10.6.2 Enterprise Bean Class
The following are the requirements for an entity bean class:
The class must implement, directly or indirectly, the javax.ejb.EntityBean interface.
The class may implement, directly or indirectly, the javax.ejb.TimedObject interface.
The class must be defined as public and must be abstract. The class must be a top level class.
The class must define a public constructor that takes no arguments.The class must not define the finalize() method

Thanks

-- Ravi

[ March 25, 2005: Message edited by: Ravindra Janapareddy ]
[ March 25, 2005: Message edited by: Ravindra Janapareddy ]
 
amol deshpande
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi , its not talkin about Bean Provider giving no arg constructor.So do expect op. 2 to be a valid answer.
Read it as class must HAVE.....
Amol.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic