It's a pretty common mistake. For more information, default values (or lack thereof) are covered in the basic tutorials: Primitive Data Types (The Java™ Tutorials > Learning the Java Language >...
Type: Posts; User: KevinWorkman
It's a pretty common mistake. For more information, default values (or lack thereof) are covered in the basic tutorials: Primitive Data Types (The Java™ Tutorials > Learning the Java Language >...
No, like I said, local variables do not have a default value, including null. If you want the default value to be null, you have to set it as such.
If that code works correctly, then you have...
I know. I'm telling you what the error message means. I actually don't think any of your code compiles.
Stick with your original code. The error is happening because local variables do not have a default value. So what should the method return if employeeList is empty?