View Single Post
Join Date: Oct 2007
Posts: 13
Reputation: alexasmith is an unknown quantity at this point 
Solved Threads: 0
alexasmith alexasmith is offline Offline
Newbie Poster

Re: Interger Arrays---Need Help!

 
0
  #8
Nov 15th, 2007
sorry i thought I had given you the correct one but this is the one I am working on---


import java.util.Scanner;
import java.io.*;

public class AKL
{



//---------------------------------------------------------------------------
// Method main Class NKOp8
//
//---------------------------------------------------------------------------
public static void main(String[] args) throws IOException
{

int num =0;
int[] myInts1;
int[] myInts2;


Scanner scan = new Scanner(System.in);


System.out.println("Please enter the size of ARRAY 1 : ");
num = scan.nextInt();
myInts1 = new int[num];

System.out.println("Please enter the size of ARRAY 2 : ");
int num1 = scan.nextInt();
myInts2 = new int[num1];

ReadArray(myInts1);

} // ends main

public static void ReadArray(int []array)
//-------------------------------------------------------------------------
// Read Array Method
//
//-------------------------------------------------------------------------
{

Scanner scan = new Scanner(System.in);
System.out.println("Please enter the elements for ARRAY1 : ");

for (int index = 0; index < myInts1.length; index ++)
{
myInts1[index] = scan.nextInt();
}


for (int index = 0; index < myInts1.length; index ++)
{
myInts2[index] = scan.nextInt();
}



}//end of ReadArray

}//end class
Reply With Quote