1 2 3 4 5 6 7 8 9 10 11 12
//version 7 import lombok.val; import java.io.IOException; public class ValInTryWithResources { public void whyTryInsteadOfCleanup() throws IOException { try (val in = getClass().getResourceAsStream("ValInTryWithResources.class")) { val i = in; val j = in.read(); } } }