Question: //return rule break

```
class Fianalblck
{

    public static void main(String... s)
    {
        //int show

        int x;
        {
            try {
                return 10;
            }
            catch(Exception e)   {

            }
            finally {
                return 20;
            }
        } System.out.println(x);
    }
}

```

Answer: 
void means the method cannot return any value. if you wish to quit the application with exit code you can use System.exit().

```
   public static void main(String[] args) {
    System.exit(10);
}

```

refer [Can a main method in Java return something?](https://stackoverflow.com/questions/7130264/can-a-main-method-in-java-return-something)
I guess this is what you want to do:

```
class Fianalblck
{
    private int func() {
        try {
            return 10;
        }
        catch(Exception e)   {

        }
        finally {
            return 20;
        }
    }
    public static void main(String... s)
    {
        Fianalblck f = new Fianalblck();
        int x;
        x = f.func();
        System.out.println(x);
    }
}

```

You want to try whether 10 or 20 will be returned from a method.

In java, you have to declare a new method, and call that method with the instance of Fianalblck.