reset() vs clear()
843838Aug 14 2006 — edited Aug 15 2006I 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()?