Thursday, February 1, 2018

java - I cannot find the logic error in this conditional statement. I don't exactly know where my logic is incorrect

I have the following statement...



personName[0] = n[y].getName().equals ("Penny") ? personName[0]++ : personName[0];



personName[] is an integer array. getName returns a string. Every time getName is equal to "Penny," I want personName[0] to add one. How should I do this? When I run it, personName[0] does not add one and I don't know why.

No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...