OverLimit Exception handling in java
<p>Program to raise an exception stating "Further Transactions Not Possible until clearance of bill." when a customer's unpaid credit card amount cross $2000 or is unpaid upto 45 days. Assume that the current date is <code>01/12/2015</code>.</p>

<ol>
<li>Create a custom exception class <code>OverLimitException</code> which extends <code>Exception</code>.</li>
<li>Add a constructor which takes a <code>Throwable</code> object, calls the super class constructor using <code>super()</code> and prints the output as described in the problem statement.</li>
</ol>

<p>I created two classes one main and the other account</p>

<p>Account.java</p>

<pre><code>import java.text.*;
import java.util.*;
import java.util.concurrent.TimeUnit;

public class Account {

String accountNumber;
String accountName;
Double dueAmount;

public Account(String accountNumber, String accountName,Double dueAmount) throws ParseException {
    this.accountNumber = accountNumber;
    this.accountName = accountName;
    this.dueAmount = dueAmount;
}

public Account() {
}

public Boolean validate(String dueDate,Double unpaid,Double amount){
    DateFormat sf = new SimpleDateFormat("dd/MM/yyyy");
    sf.setLenient(false);
    try{
        Date d = sf.parse(dueDate);
        Date d1 = sf.parse("01/12/2015");
       // long curDate = new Date().getTime();
        long diff =d1.getTime() - d.getTime();
        long daysDiff = TimeUnit.DAYS.convert(diff, TimeUnit.MILLISECONDS);
        if(daysDiff &gt; 45 || unpaid &gt; 2000){
            throw new OverLimitException("Further Transactions Not Possible until clearance of bill.");
        }
    }catch(Exception e){
        return false;
    }
    return true;
}

public void display() {       
    System.out.println("Transaction successsfully completed.");
    System.out.println("Account Number : "+this.accountNumber);
    System.out.println("Account Name : "+this.accountName);
    System.out.println("Unpaid Amount : "+this.dueAmount);
}
}
</code></pre>

<p>But am getting an error stating</p>

<pre><code> error: cannot find symbol
 throw new OverLimitException("Further Transactions Not Possible until clearance of bill.");
 ^
 symbol: class OverLimitException
</code></pre>

<p>Can any one please help me solve this problem?</p>