How to create an if statement for the following error? : <p>I would like to know how to add an if statement for the following error:</p>

<pre><code>Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 2
at Calendar.main(Calendar.java:14)
</code></pre>

<p>In other words, I would like to display the following text when the following error is triggered, "Error. Please enter the missing elements."</p>
