Browse Source

Methode hinzugefügt

main
Johanna Bröcher 3 years ago
parent
commit
9fcfbcbd70
  1. 9
      ArrayManipulation.java

9
ArrayManipulation.java

@ -11,6 +11,15 @@
return arr;
}
public static int[] squareEach(int[] arr)
{
int[] neu = new int[arr.length];
for(int i=0; i<arr.length; i++)
{
neu[i] = arr[i] * arr[i];
}
return neu;
}
public static void main(String[] args) {
int[] arr = {1,2,3,4,5};

Loading…
Cancel
Save