Results 1 to 3 of 3
- 05-29-2008, 10:43 PM #1
Member
- Join Date
- May 2008
- Posts
- 1
- Rep Power
- 0
trying to do a cumulative addition and getting a null pointer exception
if (a!= null ){
b.setClaSubBalance(new Double(b.getClaSubBalance().doubleValue() + a.getClaSubBalance().doubleValue()));
}
where a and b are objects of a class.
In the very first loop the values in b will be null. How can I handle this.
- 05-29-2008, 11:40 PM #2
I really don't understand that thing in brackets but why not just give b an initial value of 0 or something?
You just got T4NK3D!
Adonrcicg to rcesraeh the haumn mnid is clbapae of rdanieg tihs. -Jvaa Sun Moricyssemts-
- 06-02-2008, 05:30 PM #3
Member
- Join Date
- Mar 2008
- Posts
- 6
- Rep Power
- 0
Similar Threads
-
Null pointer Exception
By peiceonly in forum New To JavaReplies: 8Last Post: 09-05-2010, 06:48 PM -
[SOLVED] Cant figure out null pointer exception
By todd2230 in forum New To JavaReplies: 6Last Post: 05-06-2008, 07:45 AM -
Null pointer Exception. after a bit of execution!! Plz help me
By rohan in forum Java AppletsReplies: 2Last Post: 05-01-2008, 10:14 AM -
Null pointer exception error
By brownie_jedi in forum New To JavaReplies: 3Last Post: 03-15-2008, 06:27 AM -
statement null pointer exception
By bbq in forum JDBCReplies: 1Last Post: 07-05-2007, 04:23 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks