I would like to create a method that can cut the word variable and put each letter in the array tab[]
.
Here is my effort.
public class Mot {
private String mot;
private String tab[];
//getter et setter
public String getMot() {
return mot;
}
public void setMot(String mot) {
this.mot = mot;
}
//constructeur plein
public Mot(String mot, String[] tab) {
this.mot = mot;
this.tab = tab;
}
//constructeur vide
public Mot(){
}
//methodes
public void affichage(){
System.out.println(this.tab[1]);
}
//placage de chaque lettre dans un tableau
public void tableau(){
this.tab = this.mot.split(mot);
}
}