diff options
Diffstat (limited to 'tests/features152/synchronization/BasicProgram1.java')
-rw-r--r-- | tests/features152/synchronization/BasicProgram1.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/features152/synchronization/BasicProgram1.java b/tests/features152/synchronization/BasicProgram1.java new file mode 100644 index 000000000..7e1491300 --- /dev/null +++ b/tests/features152/synchronization/BasicProgram1.java @@ -0,0 +1,21 @@ +// Subject to LTW + +public class BasicProgram1 { + + public static void main(String[] args) { + new BasicProgram1().nonstaticM(); + staticM(); + } + + public static void staticM() { + synchronized (String.class) { + System.err.println("static method running"); + } + } + + public void nonstaticM() { + synchronized (this) { + System.err.println("nonstatic method running"); + } + } +}
\ No newline at end of file |