To split your word or mot
variable, simply use String#toCharArray
char[] letters = this.mot.toCharArray();
This will let you navigate the string per-character using an int
index.
I'm not entirely certain how you want to assign the word to the tab[]
table however, seeing as it is a String
type but it seems you want characters in it. If you want tab[]
to simply be the characters in the string, then just assign it accordingly with the return value of toCharArray
If they absolutely must be strings, then you can just translate it to a String array of characters:
char[] raw = this.mot.toCharArray();
this.tab = new String[raw.length];
for(int i = 0; i < raw.length; i++) {
this.tab[i] = Character.toString(raw[i]);
}