i got this question in an interview, and i am confused about the correct answer, so please advise.
Which of the following is not required while you are developing a bean ?
- Implementation of serializable.
- Default constructor.
- Introspection ability.
- Delegation model.
- Implementation of SingleThreadModel
According to Wikipedia, a default constructor is required as well as getters/setters (aka accessors/mutators) for all bean properties, which facilitates introspection.
It also says they should be serializable. I am not sure how much to read into the use of “should”, but I’m not surprised. I have seen many non-serializable beans. But I honestly do not know if that is legal or not. You’d have to check the spec to be certain. I would recommend serializability wherever possible.
However, I have never heard of SingleThreadModel or delegation model. So I think the correct answer would be that the last 2 items are not required.
http://en.wikipedia.org/wiki/JavaBeans