From 46086d6e57026212fdfc83b150a264f2cff2f51c Mon Sep 17 00:00:00 2001 From: Bernhard Urban Date: Sun, 20 May 2012 14:27:26 +0200 Subject: [PATCH] tests: static classes --- tests/StaticClass1.java | 13 +++++++++++++ tests/StaticClass2.java | 18 ++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 tests/StaticClass1.java create mode 100644 tests/StaticClass2.java diff --git a/tests/StaticClass1.java b/tests/StaticClass1.java new file mode 100644 index 0000000..31957e1 --- /dev/null +++ b/tests/StaticClass1.java @@ -0,0 +1,13 @@ +package tests; + +public class StaticClass1 { + public static class SC { + public static void printMe(int huhu) { + System.out.printf("I'm SC, and you say \"%d\"\n", huhu); + } + } + + public static void main(String []args) { + SC.printMe(1337); + } +} diff --git a/tests/StaticClass2.java b/tests/StaticClass2.java new file mode 100644 index 0000000..3f5f253 --- /dev/null +++ b/tests/StaticClass2.java @@ -0,0 +1,18 @@ +package tests; + +public class StaticClass2 { + public static class SC { + public static int b; + public int hrm = 543; + public void printMe(int huhu) { + System.out.printf("I'm SC %d %x, and you say \"%d\"\n", hrm, this.b, huhu); + } + } + + public SC a = new SC(); + + public static void main(String []args) { + SC.b = 0x1337; + new StaticClass2().a.printMe(888); + } +} -- 2.25.1