answersLogoWhite

0

The cheap way out, just use what java has available: the Arrays class (of course you have to import it first). int[] array = {42, 12, 1337, 0}; // the four numbers to be sorted Arrays.sort(array); //Now array is sorted

// array should now contain {0, 12, 42, 1337}; Of course there are other ways to sort, especially writing algorithms yourself, but that's such a bore. Just for reference I have attached links to common sorts below.

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

What Program that will display the even numbers in data structures and algorithms?

JAVA


How do you compile and execute a java program which finds out the highest of any five numbers?

it will be destroyed.


What do you mean by multithread program in java?

A Program in Java that spawns multiple threads is called a multithreaded program in Java.


What does it mean to generate random numbers in Java?

Generating random numbers in Java is somewhat of a misnomer because the numbers are actually semi-random.It means to use the program to obtain random integers to use in hypothetical situations such as statistics.


Java program to find sum on even numbers from 12-45?

sum = 0; for (int i = 12; i


What is java program on computers?

#!/usr/bin/perl print 'java program';


What is java virtucal mechine?

That refers to the program that runs the compiled Java program.


What powder game doesnt need java?

Any program written for the Java technology needs Java. Any program NOT written for Java DOESN'T need it.


How do you write and execute java program?

In theory, you can write a Java program in just about any text editor; then you can compile it with the "javac" command, and - if the compilation works without errors - run it with the "java" command. In practice, and especially for new programmers, I would recommend that you get a good Java IDE, which lets you do everything in a single environment, and clearly shows where there are errors, among other benefits.


How do you write and execute the java program?

In theory, you can write a Java program in just about any text editor; then you can compile it with the "javac" command, and - if the compilation works without errors - run it with the "java" command. In practice, and especially for new programmers, I would recommend that you get a good Java IDE, which lets you do everything in a single environment, and clearly shows where there are errors, among other benefits.


Java Track?

Java Track is the java training program offered by SynergisticIT


Where can one get the program Java?

The program Java can be downloaded from the official Java website on the internet. The program is free for personal use, so it can be downloaded without any cost by anyone.