在开发Android项目时,我已经堆积在一个位置
这很简单
String[] subjects = {};
//It is a string array what I want transform by another
String[] another = {"Physics","Chemistry"};
如何将主题替换为另一个
答案 0 :(得分:2)
像这样使用它会有所帮助
String[] subjects = {};
String[] another = {"Physics","Chemistry"};
subjects = another.clone();
或第二个选项是这样的
subjects = Arrays.copyOf(another , another .length);
这会将另一个数组复制到主题数组