+ Start a Discussion
Vinod TomarVinod Tomar 

NullPointer error in MonthBetween Method

Hi All,

I am getting below error

 

System.NullPointerException: Attempt to de-reference a null object



 

in code

 

Integer monthChangecount  = firstDate.monthsBetween(newStartDate);

 

where firstdate is 2011-02-01 and newstartdate is 2011-01-01

AmitSahuAmitSahu

Error sloud be for some other line. Could you share a bit more code with us?