In this discussion, we\'re given the beginnings of anapplication. The main metho
ID: 3616338 • Letter: I
Question
In this discussion, we're given the beginnings of anapplication. The main method has already been created; as well asan example method. I would like to add a "different" method and"add a line" to the main method to test the newly created method.Can someone show me how to use one of the following in thenew method and comment the code, providing adescription of what the method does?: Static Class, OverloadingMethods, Overloading Constructors, toString, Passing Objects asarguments, Aggregation, this reference variable, Inner Classes,Enumerated Types, Equals, Array, ArrayList, Two-dimensional Arrays,Arrays of Objects.
Starting point:
Explanation / Answer
please rate (both answers) - thanks This is the one I added it uses Static Class, PassingObjects as arguments, Aggregation, this reference variable, Array from your list As you see it's already comments, but I'll add some more public static void sort(int num[]) /* This exchange sort works bycomparing the firstelement with each of the elements of the array after it, making anynecessary swaps. After the first pass through thearray is complete, the smallest number will be in the 1st elementof the array, so we then take the second element and compare itwith each of the elements after it swapping elements that areout of order, when this pass is done the 2nd element of the arraywill have the 2nd smallest value in it. This sorting processcontinues until the entire array is ordered.*/ {int temp,i,j,n; n=num.length; //get number of elements in thearray for(i=0; iRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.