posted 18 years ago
No, you do not need to initialize your properties but according to the "JavaBeans" guidelines "JavaBeans" must have a no-arg constructor. This is not a compiler requirement but is required by tools/frameworks (e.g. Hibernate, Castor XML, ...) which need to make instances of your classes using reflection.
If you want to init your properties you could use "chained constructor":
which looks nicer and is easier to maintain (you only need to init the properties in one constructor, validation (e.g. checking for null) can be put in one place and so on.
pascal