1)I am trying to assign the value "(votes + " : " + Str2)" as an element of the String Results at the end of my for loop. So at the end of every loop, there is a new entry made to String Results.
I am not sure whether it has gotta do with contenating.
2)line 80 compilation error states having incompatible types.
I have tried explicit casting to String, but it does not help. I am aware that variable "votes" is an integer and Str 2 is a String. But I would want to store "(votes + " : " + Str2)" as a String, as an element of String Results.
Your help is very much appreciated. Thanks sooo much!!
+ is only applicable to numeric primitives (and because of auto-unboxing, also numeric wrapper types) and Strings, not String arrays. You may want to switch from a String to a List<String> so you can use the add method.