Arrays In Java
Arrays In Java Arrays: It can be defined as the collection of similar elements together . Array Size Starts from "0" and ends at "n-1" Example: Collection of student roll numbers comes under one single integer array. Collection of student names comes under one single String array. Collection of Faculty salarys comes under one single Float array. Types Of Arrays: There are three types of arrays they are : One/Single dimensional array Two Dimensional array Multi Dimensional array 1.One/Single Dimensional Array: One Dimensional array is used to collect the set of elements together . The Size of the array can be defined as "Product of number of bytes of datatype and size of the array." Size of an array= number of bytes used by datatype * size of the array. Syntax: Initializing an array: <datatype>[] variable={values}; Example for initializing : int[] a={10,20,30,40}; Declaring an array: ...