Though I am not in any mood to start controversy here but looking for the best way to initialize the variables when we don't have the values to be assigned at run time.
In this situation, I can either initialize reference variables to Null, empty or left them uninitialized.
Though local and final variables will give compilation errors if left uninitialized so they have to be either empty or null initialized.
What is you call on the following ways of initializing variables. And how to handle erroneous conditions in a program regarding these initializations. Is it good to place null checks or checks for empty initializations.
What do you mean by reference variables? Do you mean fields? What does Null, empty or ... uninitialised mean?
If you have values which are uninitialised at runtime, why do you have those variables in the first place? If you have a final field which you are initialising to null, that looks like poor design to me. Get rid of whichever constructor initialises those values to null.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com