Help with null pointer exception...
Hi,
I don't know why but i'm getting a null pointer exception when i call this method.
/**
* To String method
*/
public String toString()
{
String returnString;
returnString =" House ID : "+ id +"\n House address : " + address +"\n Date Built : " + df.format(dateBuilt) +"\n Selling price : " + nf.format(sellingPrice)
+"\n Sold : " + isSold +"\n";
if(soldDate!=null){
returnString +=" Date of sale : "+ df.format(soldDate);
}
return returnString;
}
My instance variables are as follows..
private String id;
private String address;
private double sellingPrice;
public boolean isSold;
private Date dateBuilt;
private Date soldDate;
private Buyer buyer;
private boolean yearDifference;
private DateFormat df;
private double stampDuty;
private NumberFormat nf;
Can anyone help me? Thanks

