Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save soheil-ghahremani/8c359a7a8970589d5c0118a803b62f6e to your computer and use it in GitHub Desktop.
Save soheil-ghahremani/8c359a7a8970589d5c0118a803b62f6e to your computer and use it in GitHub Desktop.
package ir.soheil_gh;
public class LocalVariableTypeInferenceExample4WithError {
public static void main(String[] args) {
var test = null;
}
}
@soheil-ghahremani
Copy link
Author

Error:(5, 13) java: cannot infer type for local variable test (variable initializer is 'null')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment