Re: increment letters
- From: Roedy Green <see_website@xxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 31 Jul 2007 20:25:54 GMT
On Tue, 31 Jul 2007 20:16:37 -0000, Twisted <twisted0n3@xxxxxxxxx>
wrote, quoted or indirectly quoted someone who said :
add(new JButton(""+'A'+i));
This works in C; less sure about Java. There's also:
That won't work. The problem is + promotes 'A' to an int. You then
effectively have ""+ 65 which will generate the string "65".
There are a number of related gotchas. See
http://mindprod.com/jgloss/gotchas.html#CONCATENATION
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
.
- References:
- increment letters
- From: glennsnoise
- Re: increment letters
- From: Twisted
- increment letters
- Prev by Date: Re: increment letters
- Next by Date: Re: Detecting CPUs and cores
- Previous by thread: Re: increment letters
- Next by thread: Re: increment letters
- Index(es):