What are Arrays in Java?

String[] Class = new String[100];// declaring and allocating a memory of 100 stringsClass = {"Ateev", "Arun", "Rohit" ..... "Subash"};// initializing elements

Indexing of Arrays in Java

Declaring Arrays in Java

int[] A;ORint A[];
byte[] A;           // an array of Bytesshort[] A;          // an array of Shortsint[] A;            // an array on Integerslong[] A;           // an array of Longfloat[] A;          // an array of Floatsdouble[] A;         // an array of Doublesboolean[] A;        // an array of Booleanchar[] A;            // an array of CharactersString[] A;         // an array of Strings

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Ateev Duggal

Ateev Duggal

I am a front-end developer from India with over one year of experience in freelancing with skills like Git, HTML5, CSS3, Bootstrap 4&5, and React.