In this context, j is a local variable, only "visible" within the { braces } of the while loop.
It will not conflict with other variables named j, but it will hide them, so to speak.
It would probably be clearer if you renamed that variable.
It would also be a very good idea to initialise it in the declaration,
char localJ = 0;
Just come up with a better name than *loclaJ *.
After that, it's just a variable in the block and looks like it is used to count or keep track of something, so read on with your finger on the code to see what it does for you.
And to add to what @groundFungus posted, this all comes under "variable scope", which might amuse you and keep you busy for awhile when it is learning time:
key is undefined. could be defined local - int key = kpd.getKey ();
j is defined within the loop and is used to determine where to put colons. but its' value is not properly initialized and it should be defined outside the loop like "i"
j would make more sense as an int or byte
why is the a half sec delay?
why is key set to 0 when exiting the loop
should the display be cleared at the end of the loop or the next time it is updated
Usually, I use char as a data type when the associated variable is to store ASCII code of a character (A-Z, a - z, 0 - 9, and punctuation marks) of the English Language.
In your case, j is to store the cursor position; so, its data type is more likely to be byte/int instead of char though it can be used very well as its range is: -128 to 127.