-
Notifications
You must be signed in to change notification settings - Fork 0
Arrays and Collection Framework
Büşra Oğuzoğlu edited this page Jul 3, 2022
·
31 revisions
type arrName[];
OR
type[] arrName;
arrName = new type[size];
Can be combined in one statement:
type[] myArray = new type[size];
If elements are already known, declaration/instantiation can be done in the following way:
int[] nums = {1, 2, 1, 1, 3};