Creating jar file forcing the jvm to take the desired main method
<p>I have faced this question in the interview so that I am posting this here where I believe I can get answer.</p>

<p>this is what is the question.</p>

<ol>
<li><p>I have four Java files, each one has got a main class. while creating jar file combining all these four classes how to make the jvm to invoke the main method which is there in a particular Java file. say I want the jvm to run the main method from the Class A out of B, C, D class files.</p></li>
<li><p>Pen cost is $10 but I have only $9 with me, I have no credit card, debit card or money and I should not borrow money from any body, should not use mobile and the price also is fixed but I have to buy the pen. How?</p></li>
</ol>
