Hey everyone im stuck on a java problem and i could use some help
public class Split { private ArrayList<Integer> numbers; public Split() { numbers = new ArrayList<Integer>(); numbers.add(1); numbers.add(5); numbers.add(21); numbers.add(43); numbers.add(60); numbers.add(70); numbers.add(80); numbers.add(90); numbers.add(100); } public ArrayList<Integer> splt(int n); { for(int i =0;i<numbers.size();i++){ if(i != n){ return 0; }else if(i == n){ numbers.IndexOf(i); } }
what i need to do is type in a number, if its in the list i created above it splits the array at that position
example:
int = 70
output = firstlist is {1,5,21,43,60}
Secondlist is {70,80,90,100}
i tried searching for the input number in the list if it is not there it returns zero if it is it returns the position of the element in the list


LinkBack URL
About LinkBacks
Reply With Quote