How to Use Array Declaration Initialization in java |Java Sinhala | Java For nested loop | Part 11
Channel: Mr.Dotcom
Date: 2020-09-06

Arrays
An array is a container object that holds a fixed number of values of a single type. The length of an array is established when the array is created. After creation, its length is fixed. You have seen an example of arrays already, in the main method of the "Hello World!" application. This section discusses arrays in greater detail.

Declaring a Variable to Refer to an Array
The preceding program declares an array (named anArray) with the following line of code:
Similarly, you can declare arrays of other types:

😍 Connect with us on 

   📸  Follow us on Instagram -  https://www.instagram.com/dappyoutube
   🐦  Follow us on Instagram - https://twitter.com/dappyoutube
   😊  Like us on Facebook -  https://www.facebook.com/javafreecode/
   📚   Get Insights and tips from our Blog -  http://www.ideclo.com
   

✌🏽 Also, follow me on Github for some FreeCode:  https://github.com/dotLK ✌🏽


✨🥤 CHEARS!  Thanks For Watching This Tutorial  ✨

byte[] anArrayOfBytes;
short[] anArrayOfShorts;
long[] anArrayOfLongs;
float[] anArrayOfFloats;
double[] anArrayOfDoubles;
boolean[] anArrayOfBooleans;
char[] anArrayOfChars;
String[] anArrayOfStrings;
You can also place the brackets after the array's name:

// this form is discouraged
float anArrayOfFloats[];
However, convention discourages this form; the brackets identify the array type and should appear with the type designation.
// declares an array of integers
int[] anArray;
Like declarations for variables of other types, an array declaration has two components: the array's type and the array's name. An array's type is written as type[], where type is the data type of the contained elements; the brackets are special symbols indicating that this variable holds an array. The size of the array is not part of its type (which is why the brackets are empty). An array's name can be anything you want, provided that it follows the rules and conventions as previously discussed in the naming section. As with variables of other types, the declaration does not actually create an array; it simply tells the compiler that this variable will hold an array of the specified type.
java array list
java array
java array declaration
java array length
java array to list
java array sort
java arrays
java array list
java arrays in sinhala
java array programs
java arrays in tamil
java array input from user
java arrays for beginners
java arrays and methods
java array full course
java arrays tutorial
java array of objects
java array interview questions
java arrays alex lee
java arrow function
java array methods
java array questions
java arrays exercises
java array contains