Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

reset() vs clear()

843838Aug 14 2006 — edited Aug 15 2006
I have a JavaBean holding all the data that are provided by application users via submitting a form. And I re-use those data during a 'session'.

In that JavaBean, I also use a reset() method. In that method, I set all objects to null and primitives to 0 or false.

It looks that I can use the users provided data only once if there is a reset() method in the JavaBean. The second time I access that form bean, all objects and primitives are reset.

If the clear() is specified in the form bean, I am able to re-use the users provided data during a session.

What are the exact differences between the reset() and clear()?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 12 2006
Added on Aug 14 2006
4 comments
224 views