package java_samples_hwang;
/**
*
* @author hwang
*/
public class ArrayDemo {
public static void main(String args[])
{
int[] anArray; // declares an array of integers
anArray = new int[5]; // allocates memory for 10 integers
anArray[0] = 100; // initialize first element
anArray[1] = 200; // initialize second element
anArray[2] = 300; // etc.
anArray[3] = 400;
anArray[4] = 500;
System.out.println("Element at index 0: " + anArray[0]);
System.out.println("Element at index 1: " + anArray[1]);
System.out.println("Element at index 2: " + anArray[2]);
System.out.println("Element at index 3: " + anArray[3]);
System.out.println("Element at index 4: " + anArray[4]);
}
}
'백엔드기술 > 개발언어' 카테고리의 다른 글
Connect sample (0) | 2009.12.09 |
---|---|
Modularization (0) | 2009.12.09 |
VB.NET, C# and VC++ Comparison (0) | 2009.12.09 |