Created
September 2, 2013 17:41
-
-
Save patelrohan/6415386 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
import java.util.Scanner; | |
public class Quad { | |
public static void main(String args[]) | |
{ | |
ArrayList resultArray= new ArrayList(); | |
ArrayList elementArray= new ArrayList(); | |
System.out.println("Enter the number of elements you want:"); | |
Scanner scanner= new Scanner(System.in); | |
//int numberOfElemnets= scanner.nextInt(); | |
getElements(scanner.nextInt()); | |
} | |
public static void getElements(int number) | |
{ | |
for(int i=0;i<number;i++) | |
{ | |
resultArray.add(number); // can't access elementArray here. -------------------- Issue --------------------- | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
import java.util.ArrayList;
import java.util.Scanner;
public class Quad {
ArrayList resultArray = null;
ArrayList elementArray= null;
public static void main(String args[])
{
resultArray= new ArrayList();
elementArray= new ArrayList();
}