double cannot be dereferenced
843810Feb 10 2003 — edited Dec 4 2006I am getting these errors when I try to compile my code, any idea what double cannot be dereferenced means?
Thanks
Milanco
public class Check
{
private String payee;
double amount;
private int CheckNumber;
private static int numberOfChecks = 0;
public Check (String p, double a) throws CheckException
{
payee = p;
amount = a;
CheckNumber = ++numberOfChecks;
if(amount.length() == 0)
{
throw new CheckException("Amount empty", this);
}
if(payee == null)
{
throw new CheckException("No payee", this);
}
}
public String toString()
{
return ("Check = " + payee + "\n" + "Amount = " + amount + "\n" + "Check Number = " + CheckNumber);
}
}
C:\mgt283code\Work1\Assigment3\Check.java:16: double cannot be dereferenced
if(amount.length() == 0)
^
C:\mgt283code\Work1\Assigment3\Check.java:18: cannot resolve symbol
symbol : constructor CheckException (java.lang.String,Check)
location: class CheckException
throw new CheckException("Amount empty", this);
^
C:\mgt283code\Work1\Assigment3\Check.java:23: cannot resolve symbol
symbol : constructor CheckException (java.lang.String,Check)
location: class CheckException
throw new CheckException("No payee", this);
^
3 errors
Process completed.