I have a problem startsWith() !!!!!

Hi,

A piece of my application is like this:

int TarimSayac=0;

int TarimEksiltSayac=0;

for (int j = 0; j < v.size(); j++){

...

String ipc = obj.getIPCID();

if(ipc.startsWith("A01")) TarimSayac++;

elseif(ipc.startsWith("A01N")) TarimEksiltSayac++;

elseif(...) .....

else .....

}

System.out.println("tarim sayac "+TarimSayac);

System.out.println("tarim eksilt sayac "+TarimEksiltSayac);

I think, there is a problem about startsWith in my application.Because the statement System.out.println("tarim sayac "+TarimSayac);

has run correctly, but it hasn't run with the statement System.out.println("tarim eksilt sayac "+TarimEksiltSayac);

In the loop while the value of counter TarimSayac

is increasing, value of counter TarimEksiltSayac

returns allways null.

I have compared the result of my application with database and there must exist value of TarimEksiltSayac

in my application.

I don't understand why my application doesn' t count ipc s that starts with"A01N"

?

I will be very plaesed when I learn my mistakes.

Thank u:))

Message was edited by:

a5x

Message was edited by:

a5x

Message was edited by:

a5x

Message was edited by:

a5x

[1906 byte] By [a5xa] at [2007-11-26 18:24:15]
# 1
Wrong forum, see http://forum.java.sun.com/ann.jspa?annID=14You should try this forum instead: http://forum.java.sun.com/forum.jspa?forumID=54
PeterAhea at 2007-7-9 5:58:19 > top of Java-index,Core,Core APIs...