Associate
- Joined
- 6 Dec 2007
- Posts
- 2,103
Hey all (again), this time I was trying to write a piece of code to sort some details, and a line in particular keeps throwinb up a NullPointerException, and I can't figure out why. My head hurts.
public void sortAccountDetails()
{
int iAccountNumber;
for (int i3 = 0; i3 < accountDetails.length -1; i3++)
{
int minPos = i3;
for ( int j3 = i3 +1; j3 < accountDetails.length; j3++ )
{
iAccountNumber = Integer.parseInt( accountDetails [ j3 ].getAccountNumber() );
if ( iAccountNumber < Integer.parseInt( accountDetails [ j3 ].getAccountNumber()))
{
minPos = j3;
}//end if
}//end for
The bold bit is giving me jip. It's not the parseInt doing funny things to my array is it? Thanks
public void sortAccountDetails()
{
int iAccountNumber;
for (int i3 = 0; i3 < accountDetails.length -1; i3++)
{
int minPos = i3;
for ( int j3 = i3 +1; j3 < accountDetails.length; j3++ )
{
iAccountNumber = Integer.parseInt( accountDetails [ j3 ].getAccountNumber() );
if ( iAccountNumber < Integer.parseInt( accountDetails [ j3 ].getAccountNumber()))
{
minPos = j3;
}//end if
}//end for
The bold bit is giving me jip. It's not the parseInt doing funny things to my array is it? Thanks