Using an "if" statement when there is no arg
<p>Im supposed to be giving the program two arguments: one for current speed in mph and the other, the speed limit in kph.  My program must use the converter file to change your current speed to kph so as to be compared to the speed limit then warn the user via Dashboard display that they are speeding.  But if only one arg is given, the program must use 40kph as the default speed limit.  My problem lies in not knowing how to code  an IF statement for a lack of args. Help!?!</p>

<pre><code>public class DetailedSpeedSetter
</code></pre>

<p>{</p>

<pre><code>public static void main(String args[])
{
        double kph;
        double mph;
        double SpeedLimit;


        mph = Text.toNonnegativeDouble(args [0]);

        kph = Converter.toKPH(mph);

        SpeedLimit = Text.toNonnegativeDouble(args[1]); 



 /**
 * Determines whether the given speed exceeds the given limit
 *
 * @param speed      The speed in km/hr
 * @param limit      The speed limit in km/hr
 * @return           true if speed exceeds limit and false otherwise
 */
public static boolean isSpeeding(double speed, double limit)
{
    speed = kph;
    limit = SpeedLimit;

    if (speed &gt; limit); 

    return true;

   if (speed &lt;= limit);

    return false;

        }


        Dashboard.setSpeed(kph);
        Dashboard.setSpeeding();

        }
    }
</code></pre>
