title: Return value from a Java code
body: <p>There is a Java class which creates a POST request and sends it to a servlet.
  The main method of the class file (test) looks something like this:</p>
  
  <pre><code>public static void main(String[] args) throws IOException {
    // Code logic goes here...
    // No return Statement
  }
  </code></pre>
  
  <p>This is called from a KornShell (ksh) script something like this: </p>
  
  <pre><code>retcode=`$CLK_JAVA_PATH -cp $CLASSPATH test ${PASSWORD} ${HOSTNAME} ${TOOLSET}`
  
  if [ $? != "0" ];then
          echo "ERROR:  
          echo "${retcode}"
  else
          echo "${SCRIPT} Success"
  fi
  </code></pre>
  
  <p><code>retcode</code> always has the value "2" independent of if the code fails or succeeds.
  My question is since the return type of my main method is "void" why is the code returning some value?</p>