This commit is contained in:
2019-11-15 22:21:23 +01:00
parent 6e2c77ab31
commit 17e4bc97f2
2 changed files with 55 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
package org.eidecker.oca8lernen.general;
import org.junit.jupiter.api.Test;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
public class FunWithArrays {
@Test
public void testArrays() {
int[] ints = new int[] {1, 3, 4, 6, 7};
List[] lists = {new ArrayList(), new ArrayList()};
ArrayList[] arrayLists = {new ArrayList(), new ArrayList()};
int [] one = {1,2,4};
int [][] tow = {one};
int[][][][] strings = new int[3][3][][];
strings[1][2] = new int[][]{{1},{2}};
System.out.println(strings[1][2].getClass().getName());
// lists = arrayLists;
// arrayLists = (ArrayList[]) lists;
arrayLists[0].size();
}
}

View File

@@ -0,0 +1,20 @@
package org.eidecker.oca8lernen.general;
import org.junit.jupiter.api.Test;
public class Loop {
@Test
public void testLoops() {
int i = 1;
/*do
System.out.println("Hallo");
while(i == 1);
*/
System.out.println("Hallo");
while(true);
}
}