Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

double cannot be dereferenced

843810Feb 10 2003 — edited Dec 4 2006
I 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.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 1 2007
Added on Feb 10 2003
8 comments
452 views