Can a main method in Java return something?
<p>I gone through an interview recently and they ask me two question in core Java.</p>

<p>Q 1.</p>

<blockquote>
  <p>Can we write a java class with:</p>

<pre><code>public static int main(String[] args){
     System.out.println("Hello");
</code></pre>
</blockquote>

<p>I answered: No The complier wont compile it as it is expecting return type of <code>main</code> to be <code>int</code> though we can overload it.</p>

<p>Q 2: Next question I unable to answer.</p>

<blockquote>
  <p>Write a program so that your Java <code>main</code> method could return something.</p>
  
  <p>I.e. how can you make <code>public static void main([] args)</code> to return something?</p>
</blockquote>

<p>Can any body help me to answer this?</p>

<p>Thanks</p>
