In Object Array = all elements are same… After assign data

后端 未结 3 1081
星月不相逢
星月不相逢 2021-01-21 23:15

For Example if I Create array of object And assing data...

short version of problem. array[0].init(\"ce\", 2) array[1].init(\"nh\", 2)

Output... Of array[0] Will

3条回答
  •  没有蜡笔的小新
    2021-01-21 23:58

    If a data member is static, this means that it is shared by all instances of the class:

    public static String ch_v;
    public static int x = 0, y = -5, y_max = 325;
    

    Remove the two static modifiers.

提交回复
热议问题