Ejercicios Capitulo 04 bloque09

This commit is contained in:
2024-11-13 12:08:30 +01:00
parent c3b731671a
commit e7ff98025c
5 changed files with 133 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
package capitulo04.bloque09;
public class Ejercicio01 {
public static void main(String[] args) {
int[] array = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
System.out.println(stringFromArray(array));
}
public static String stringFromArray(int[] array) {
StringBuffer sb = new StringBuffer();
for (int i = 0; i < array.length; i++) {
sb.append(array[i] + " ");
}
return sb.toString();
}
}