how to multidimensional array Object to String in java
public class test {
public static void main(String[] args) {
Object[][] obj = { { "1", "2", "3" }, { "1", "2", "3" }, { "1", "2", "3" } };
System.out.println(Arrays.deepToString(obj));
String[][] argument = Arrays.stream(obj).map(a -> Arrays.stream(a).map(Object::toString).toArray(String[]::new)).toArray(String[][]::new);
for (int i = 0; i < argument.length; i++) {
for (int k = 0; k < argument[i].length; k++) {
System.out.println(argument[i][k]);
}
}
}
}
Buat apa itu?
Posted using Partiko Android
ia adalah pasangan kod bahasa java.
Congratulations @carlton.soul! You have received a personal award!
1 Year on Steemit
Click on the badge to view your Board of Honor.
Do not miss the last post from @steemitboard: