I have a coordinate class with two int
s that has a method to show the coordinate as "A1" or "C5".
For the letter I'm using a char, and I don't know what's the best way to concatenate the two variables.
The return of the method looks like this:
//letter is a char
//line is an int
return letter+""+line;
I'm using ""
because it implicitly casts the char and the int as strings. If letter
was a string I could just do return letter+line;
but with a char
the implicit conversion doesn't work.
I'm not really satisfied with this way, should I? What would be a cleaner way to do it?