package JavaSessions;
public class StaticArray {
public static void main(String args[]) {
//limitations of array:
//1. size is fixed: static array : to overcome this problem, we use dynamic array or ArrayList
//2. stores similar types of values: to overcome this problem, we use dynamic array or Object array
//1. int:
int i[] = new int[4];
i[0]=10;
i[1]=20;
i[2]=30;
i[3]=40;
System.out.println(i[1]);
System.out.println(i[0]+i[1]);
System.out.println(i.length); //size of array
//System.out.println(i[4]); //ArrayIndexOutOfBoundsException
//to print all the values of array: use for loop:
for(int k = 0; k