I am using Java and I am using a vector 'set' to store data
This is created from a text file as I read each line and store it in an array values[]. Then I have a vector 'set' and for each line I add values[] to the vector 'set' so set looks as shown as above after all the data from the text file is read.
Then the user is given a choice to input the amount of data he wants, for example if he enters 50, half of the vector (the first 7 lines) would be taken by using:
public void pro(int percentage)
{
int noOfEx = percentage*set.size()/100;
root.keptEx = new Vector(set.subList(0, noOfEx));
}
However, I wish that the lines are taken randomly and not after each other but I cannot figure out how to do it with random. Also is there a way how to print out the values of the vector? since
System.out.println(keptEx)
displays weird symbols not the actual contents.