1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
class Matrice {
static String[][] tab = new String[][]{{"a","1"}
,{"b","2"}
,{"c","3"}
,{"d","4"}};
}
class Test {
public static void main(String... args){
System.out.println(Arrays.deepToString(Matrice.tab));
Matrice m = new Matrice();
m.tab = new String[][]{{"w","23"}
,{"x","24"}
,{"y","25"}
,{"z","26"}};
System.out.println(Arrays.deepToString(m.tab));
Matrice m2 = new Matrice();
System.out.println(Arrays.deepToString(m2.tab)); // ici on conserve bien la "dernière" valeur
}
} |
Partager