new tasks
This commit is contained in:
parent
2a4d27cea0
commit
80737d5a6a
1194 changed files with 15353 additions and 1 deletions
4
Task/Arrays/Java/arrays-2.java
Normal file
4
Task/Arrays/Java/arrays-2.java
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
ArrayList <Integer> list = new ArrayList <Integer>();//optionally add an initial size as an argument
|
||||
list.add(5);//appends to the end of the list
|
||||
list.add(1, 6);//assigns the element at index 1
|
||||
System.out.println(list.get(0));
|
||||
3
Task/Arrays/Java/arrays.java
Normal file
3
Task/Arrays/Java/arrays.java
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
int[] array = new int[10]; //optionally, replace "new int[10]" with a braced list of ints like "{1, 2, 3}"
|
||||
array[0] = 42;
|
||||
System.out.println(array[3]);
|
||||
Loading…
Add table
Add a link
Reference in a new issue