![]() |
|
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Hobbyist Programmer
Join Date: Mar 2005
Posts: 139
Rep Power: 4
![]() |
Hi All,
This gives me a null pointer exception: System.out.println("\nThere are " + polyInstance.signChanges(tempCoefsArray, noCoefs) + " positive real roots in the equation you entered\n");
......other non important code here.....
public int signChanges(String tempCoefsArray[], int noCoefs)
{
int signChanges=0;
for(int i=0; i<=tempCoefsArray.length-2; i++)
{
if(tempCoefsArray[i].charAt(0) != tempCoefsArray[i+1].charAt(0))//null ptr here
{
signChanges++;
}
}
return signChanges;
}Last edited by paulchwd; Apr 14th, 2007 at 12:20 AM. |
|
|
|
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Function Parameters | grimpirate | PHP | 10 | Mar 14th, 2007 6:55 PM |
| C# corruption!!! | Kilo | C++ | 32 | May 21st, 2006 8:44 PM |
| Array issues :( | Alo Tsum | Java | 10 | Nov 26th, 2005 5:45 PM |
| A standards question, optional inputs into Methods | Arla | C# | 4 | Apr 27th, 2005 10:38 PM |
| replace space with ' * ' | TecBrain | C++ | 15 | Apr 13th, 2005 12:32 PM |