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)
Main method **cannot return a value** directly.

```
 Error: Main method must return a value of type void in class first, please
 define the main method as:
 public static void main(String[] args)

```

But you can simply use **return** in a main method.

```
public static void main(String[] args){
...
...
...
return;
}

```