Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Jayden Brown   on Sep 10 In Java Category.

  
Question Answered By: Cais Nguyen   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]);
}
}
}

Share: 

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


Tagged: