hello world.. hello programmers... i want to share to you how to make a sample program array using java..
I hope you learn and enjoy reading my blog...
import java.io.*;
public class javaarray
{
public static void main(String args[])
{
int x[]=new int[3];
x[0]=100;
x[1]=200;
x[2]=300;
//display result
System.out.println("The array[0]=" + x[0]);
System.out.println("The array[1]=" + x[1]);
System.out.println("The array[2]=" + x[2]);
}
}
next time i will post another sample program using array. using loop to print the array element.
No comments:
Post a Comment