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/a0d9be822e29ffb1cef78a079fa97015 to your computer and use it in GitHub Desktop.
Save soheil-ghahremani/a0d9be822e29ffb1cef78a079fa97015 to your computer and use it in GitHub Desktop.
package ir.soheil_gh;
public class LocalVariableTypeInferenceExample1WithError {
public static void main(String[] args) {
var test;
}
}
@soheil-ghahremani
Copy link
Author

Error:(6, 13) java: cannot infer type for local variable test (cannot use 'var' on variable without initializer)

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