Skip to content

Instantly share code, notes, and snippets.

@reime005
Created December 27, 2020 21:27
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 reime005/b75a3ebc9db41cf316ba295646a7e870 to your computer and use it in GitHub Desktop.
Save reime005/b75a3ebc9db41cf316ba295646a7e870 to your computer and use it in GitHub Desktop.
public class Test {
private String name;
public void setName(String name) {
this.name = name;
{
int nonsense = 42;
System.out.println(nonsense);
}
System.out.println(this.name);
System.out.println(nonsense); // compile error: 'cannot find symbol'
}
public static void main(String[] args) {
Test test = new Test();
test.setName("foo");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment