Int Array In Java Example Program

Chapter: Data Types Last Updated: 09-06-2016 19:59:38 UTC

Program:

            /* ............... START ............... */
                
public class JavaIntArrayExample {

	public static void main(String[] args) {
		int[] intArray = new int[3];

		intArray[0] = 1;
		intArray[1] = 2;
		intArray[2] = 3;

		for (int i = 0; i < intArray.length; i++) {
			System.out.println(intArray[i]);
		}
	}
}
                /* ............... END ............... */
        

Output

1
2
3

Notes:

  • A Java Integer Array is a an array object that holds multiple Integer values.
  • eg : int[] array = new int[10];

Tags

Int Array, Java

Similar Programs Chapter Last Updated
Java String Example Program Data Types 19-06-2016
Primitive Datatypes In Java Example Data Types 17-06-2016
Enum In Java Example Data Types 28-04-2016
Java Short Example Program Data Types 10-06-2016
Java Long Example Program Data Types 15-07-2016
Java Int Example Program Data Types 06-07-2016
Java Float Program Example Data Types 28-03-2017
Java Double Example Program Data Types 28-03-2017
Java Char Example Program Data Types 28-03-2017
Java Byte Example Program Data Types 28-03-2017
Java Boolean Example Program Data Types 28-03-2017

1