Answer to Question #200923 in Java | JSP | JSF for Shema Derrick

Question #200923

Write a Java program to sort a numeric array and a string array


1
Expert's answer
2021-05-30T15:47:53-0400
import java.util.Arrays;

public class Main {
    public static void main(String[] args) {
        int [] ints = {4,1,3,0,9,2,5};
        String[] strings = {"program","Code", "java", "Compile", "Run", "and", "Debug"};
        Arrays.sort(ints);
        Arrays.sort(strings);
        System.out.println(Arrays.toString(ints));
        System.out.println(Arrays.toString(strings));
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS