Article From:

How to create one-dimensional array instance


There are two ways to create arrays
One: Tell him how big an array you want.
int[] arr=new int[100];
//100That’s the length of the array.
2. Don’t tell him how big it is, just tell him what the data group is worth.
int[] arr =new int[]{1,2,3,4,5,6,7,8,9};
Or int [] arr={1,2,3,4,5,6,7,8};

Leave a Reply

Your email address will not be published. Required fields are marked *