From e2d0f5d9c38561d67f23754c00addb4a3547efb2 Mon Sep 17 00:00:00 2001 From: Stiver Date: Tue, 4 Mar 2014 15:13:11 +0100 Subject: initial commit --- src/test/input/TestJavac7.java | 59 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 src/test/input/TestJavac7.java (limited to 'src/test/input/TestJavac7.java') diff --git a/src/test/input/TestJavac7.java b/src/test/input/TestJavac7.java new file mode 100644 index 0000000..fb72d45 --- /dev/null +++ b/src/test/input/TestJavac7.java @@ -0,0 +1,59 @@ +package test.input; + +import java.io.FileReader; +import java.io.IOException; +import java.lang.reflect.Method; + +public class TestJavac7 { + + + public void testTryResources() throws IOException { + + try (FileReader reader = new FileReader("file"); FileReader reader1 = new FileReader("file")) { + System.out.println(); + } + + } + + public void testTryResources1() throws IOException { + + try (FileReader reader = new FileReader("file")) { + System.out.println("block"); + } catch(RuntimeException ex) { + System.out.println(ex.toString()); + } finally { + System.out.println("finally"); + } + + } + + public void testMultiCatch() { + + try { + Method method = getClass().getDeclaredMethod("foo"); + } catch (NoSuchMethodException | SecurityException e) { + e.printStackTrace(); + } + } + + + public void testSwitchString() { + + String s = ""; + switch(s) { + case "Aa": // "xyz": + System.out.println("!"); + break; + case "BB": // "abc": + System.out.println("?"); + break; + case "__": + System.out.println("_"); + break; + default: + System.out.println("#"); + } + + } + +} -- cgit v1.2.3