Created
December 27, 2020 21:27
-
-
Save reime005/b75a3ebc9db41cf316ba295646a7e870 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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