[Solved] Proper variable initialization and call from another class
No, both examples are not equal. In example one the variable is initialized at construction time and class1 cannot be instantiated without it. In example 2, the variable is not initialized and is given the default value of null until it is set at some later time setVar1 No, you will not get an exception. … Read more