0

Beginner Java task - Help!!!

Hello everyone! Im stuck a bit with the followinge code. How would you solve it and why? Thank you in advance! ——-> package jtm.activity03; import java.util.Arrays; public class Array { static int[] array; //populate it public static void main(String[] args) { //sort it // TODO Use passed parameters for main method to initialize array // Hint: use Run— Run configurations... Arguments to pass parameters to // main method when calling from Eclipse // Sort elements in this array in ascending order // Hint: use Integer.parseInt(args[n]) to convert passed // parameters from String to int // Hint: use Arrays.sort(...) from // https://docs.oracle.com/javase/7/docs/api/java/util/Arrays.html Arrays.sort(null); } public static void printSortedArray() { //print standard output System.out.println(Arrays.toString(???)); // // TODO print content of array on standard output // Hint: use Arrays.toString(array) method for this } public static int[] returnSortedArray() { // TODO return reference to this array return null; }

14th May 2020, 8:34 PM
Agggg
Agggg - avatar
1 ответ
0
Where is your try..? It contains full algorithm then what is the you getting..? post your try.. Edit: Except this, you have everything in comments so remove code out from comments. You will have your solution. https://www.javatpoint.com/command-line-argument
14th May 2020, 9:08 PM
Jayakrishna 🇮🇳