Thursday, 1 February 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

casting - Why wasn't Tobey Maguire in The Amazing Spider-Man? - Movies & TV

In the Spider-Man franchise, Tobey Maguire is an outstanding performer as a Spider-Man and also reprised his role in the sequels Spider-Man...