I have a class and a constructor that fills an array with numbers and it sort it:
public BinaryArray(int size){
data = new int[size];
for(int i:data){
data[i] = 10 + generator.nextInt(90);
}
Arrays.sort( data );
}
then in my other class where I have the main I want to print the array:
BinaryArray searchArray = new BinaryArray( 15 ); // create the Object
for(BinaryArray i:searchArray){
System.out.println( searchArray[i] );
}
but its wrong.. I also code this but it prints sth else..
BinaryArray searchArray = new BinaryArray( 15 );
System.out.println( searchArray );