I have made a series of programs, and I am facing a similar problem. This however is very strange, and maybe if you can get me around this I can find a way through the other ones:
Look at this code:
outside loop:
int iter=0;
loop:
{
blah
blah
--
if (iter ==0){
temp= P;
}
System.out.println ("This is iteration number: " + iter);
System.out.println ("The top of temp is: " + temp.top ().k1 + ";" + temp.top ().k2 + ";" + temp.top ().k3 + ";");
--blah blah
--
iter ++;
}
The Output of this program is:
At first, This is iteration number 0
The top of temp is 7; 6; 1
At next, This is iteration number 1
Null Pointer Exception: Empty Stack temp
-----------------------------------------------------------------------
Urgently needed, a way out of this trouble. All my methods are static