Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

example system using array..

  Asked By: Jayden    Date: Sep 10    Category: Java    Views: 1161
  

to all the people who's concern i would like ask a simple program on
java. that are using array.. just like inventory..

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Cais Nguyen     Answered On: Sep 10

import java.util.*;

public class GodSpeed
{
public static void main(String args[])
{
GodSpeed g = new GodSpeed();
}

public GodSpeed()
{
int array[] = new int[10];
ArrayList al = new ArrayList();

for ( int i = 0 ; i<array.length; i++ )
{
array[i]=2*i;
al.add(new Integer(2*i));
}

for ( int i = 0 ; i<al.size(); i++)
{
System.out.println("ArrayList item " + i + " is " + al.get(i));
System.out.println("Primitave array  item " + i + " is " +
array[i]);
}
}
}

 
Didn't find what you were looking for? Find more on example system using array.. Or get search suggestion and latest updates.




Tagged: