Java must be by the use of the local variable display initialization? If so, the variable b is the wrong!!!!!!!!!!
CodePudding user response:
Initialization is your b ah, you have new an array, it has been initializedCodePudding user response:
Yes, b is an array of objects, the new is initialized, bAs for the initialization of the array elements (I think lz doubts here), Java will give it an initial value, different types of default Boolean is false, int is zero, the object type is null, so new to the array object can directly use the array elements, but the array elements is the default, is likely to go wrong, usually want another assignment (especially the object types, array element is null, so for array element again new),
CodePudding user response:
Method of the variable is, class variables do not needCodePudding user response:
Java specification, one of the first initialization in useCodePudding user response: