I have two interfaces, MyapiA and MyapiB with 2 methods each. Two classes - SortA does all the sorting routines and SortB defines the arrays and generates random numbers.
In the main class, Sort I have the following code which produces the expected results using a default argument of 6 for the "x length" or number of numbers to sort. This all works well, where I am a bit stuck is getting it to accept user input or use the default value. I could hand the assignment in without this but I really want to learn how this can be done. I have played a bit with the Scanner object but am not really sure how to proceed from this point. Here is the code from my Sort class which is very simple:
public class Sort extends SortB {
// start the main method
static public void main(String[] args) {
SortB mySortB = new SortB();
mySortB.sortIncrease(6);
mySortB.sortDecrease(6);
}
}
If anyone can offer some advice on how I might introduce a small routine to have it accept user input otherwise take the default it would be greatly appreciated.
Thanks very much for an advise.