Norm Radder wrote:What I am suggesting:
First learn what a tool does and how to use it.
Then use the tool to solve your problem.
the point here is to create a random position of the array not to fill it with random numbers.
That statement contradicts the title of this thread: Fill an array with random numbers
Can you state your objective for this program?
What would be the purpose of randomly selecting a position in an empty array?
Firstly, I don't know who changed the title of this thread since my title was "new to
Java. I have queries"
The objective of this program is:
1 create an array
2.fill it with random numbers
3.choose a random position K of the array
4.sort the array with 2 ways.
I am trying to do point 3 which is to choose the random position K of the array. That's where I got confused and I do not know how to do it