Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Test {
- public int fib6() {
- System.out.println("Fib6 start");
- try {
- return rr = 8;
- } finally {
- System.out.println("Fib6 end");
- }
- }
- @SuppressWarnings("finally")
- public int fib7() {
- try {
- System.out.println("Fib7 start");
- try {
- Integer a = null;
- @SuppressWarnings("null")
- int b = a;
- return b;
- } catch (Exception e) {
- System.out.println("Exception");
- }
- } finally {
- System.out.println("Fib7 end");
- return 13;
- }
- }
- int rr = 2;
- {
- rr = 3;
- System.out.println("Static initializer (1)");
- }
- Test() {
- System.out.println("Konstruktor (1) start");
- System.out.println("Konstruktor (1) end");
- }
- Test(int k) {
- rr = k;
- System.out.println("Konstruktor (2) start");
- System.out.println("Konstruktor (2) end");
- }
- {
- rr = 5;
- System.out.println("Static initializer (2)");
- }
- public static void main(String[] args) {
- Helper.registerShutdownHook();
- System.out.println("Hello start");
- Test test = new Test();
- int res = test.fib6();
- System.out.println("---> " + String.valueOf(res));
- int res2 = test.fib7();
- System.out.println("---> " + String.valueOf(res2));
- System.out.println("Hello end");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement