Arrays are used to store multiple values in a single variable, instead of declaring separate variables for each value.
There are two types of arrays in Java they are
− Single dimensional array − A single dimensional array of Java is a normal array where, the array contains sequential elements (of same type)
− int[] myArray = {10, 20, 30, 40}
Strings, is a sequence of characters. In JAVA, strings are treated as objects.