View Answers

December 10, 2008 at 11:57 PM

Hi friend,

Code to solve the problem :

import java.util.Arrays;

public class IntSortExample {

public static void main(String[] args) {

String[] names = {"Zoe", "Alison", "David"};

Arrays.sort(names);

System.out.println(Arrays.toString(names));

int[] lengths = {1, 4, 9,7, 2};

Arrays.sort(lengths);

System.out.println(Arrays.toString(lengths));

}

}

For more information on Java Array visit to :

http://www.roseindia.net/java/beginners/arrayexamples/index.shtml

Thanks

Code to solve the problem :

import java.util.Arrays;

public class IntSortExample {

public static void main(String[] args) {

String[] names = {"Zoe", "Alison", "David"};

Arrays.sort(names);

System.out.println(Arrays.toString(names));

int[] lengths = {1, 4, 9,7, 2};

Arrays.sort(lengths);

System.out.println(Arrays.toString(lengths));

}

}

For more information on Java Array visit to :

http://www.roseindia.net/java/beginners/arrayexamples/index.shtml

Thanks

Ads

Related Tutorials/Questions & Answers:

complete this code (insertion sort) Your task is to develop part... to use a modiŻed version of insertion-sort algorithm which works as follows... inserted at last position of new list. complete step 4 in the uncompleted method

Advertisements

No complete code for AbstractWizardFormCOntroller Example No complete codes

Insertion Sort Applet I need Insertion Sort Applet code was design by Dr. Daniel Liang Please

complete the code (palindrome) Write a program that checks if a word.... complete the below code (step 3 and step 4 are not solved). import... is the standard code with full of description,so go according that u will sure find

No complete code for BeanNameUrlHandlerMapping With Command Class Example There is no complete dispatcher-servlet.xml and we couldn't download the codes

Insertion Sort Timer Welcome all I wanna program in java find the timer of insertion sort and find time complexity for random value thanks all

Insertion Sort Hello rose india java experts.If you don't mind.Can you help me.What is the code for Insertion Sort and Selection Sort that displays.... Hi Friend, Try the following code: 1)InsertionSort.java

Insertion Sort In Java ... In this example we are going to sort integer values of an array using insertion sort. Insertion sorting algorithm is similar to bubble sort. But insertion sort

Java insertion sort question I've got another program that I need help with. I am trying to write a Java method that accepts an array of strings, and sorts the strings using the insertion sort algorithm. Then I need to write

Insertion Sort Problem So I have this in a class file. It is supposed to be an insertion sorter: int min, index=0, temp; for(int i=0;i<sorted.length;i++){ min=sorted[i]; for(int j=i+1;j<

Request for complete code of the Spring 2.5 MVC User Registration Example ... to understand the Spring WebMVC flow but it is not complete. Can you please send me the complete code of this example or rest of the part. Best Regards, Uttam kumar

need complete jsp code for transactions using mysql iam doing online banking project.i want the code to transfer funds from one account to another... to lasya or lasya to prathika. I need complete jsp code for transactions using

Insertion Sort in Java is an algorithm that is used to sort integer values..., Insertion Sort in Java is less efficient when it comes to larger data sets... decreasing. How does Insertion Sort works in Java? Assume that you have 5

Java insertion sort with string array In this tutorial, you will learn how to sort array of strings using string array with Insertion Sort. For this, we... array using inserting sort algorithm. In the main method, we have invoked

Insertion sort program find calendar to array value 1000,5000,10000 program find calendar for insertion sort in jfram to array 1000

B+ tree JAVA source code for implementing Insertion and Deletion Can anyone plz mail de B+ tree JAVA source code for implementing Insertion and Deletion..Its urgent Hi friend, public class BinarytreeDemo

to use a modiŻed version of insertion-sort algorithm which works as follows...complete the program Problem Task Your task is to develop part... 2 Sorted list: 1 2 4 7 9 please complete the following program -solve proble

complete coding for shopping card complete coding for shopping card Please visit the following link: Shopping Cart Application

auto complete text box How to create auto complete text box in jsp using ajax technology ? plz giv me steps wise code

Complete example of JQuery with JAX Hi, I completed the basic J Query tutorial. But my project requirement is to use the JQuery with Ajax. Could you please provide me complete example of Jquery with Ajax integration. Thanks

Complete php tutorial Hi, I am trying to find the url to learn complete PHP in easily. Can some one provide me url for complete php tutorials. Thanks Hi, Learning PHP is now very easy from tutorials from many

Heap Sort in Java is used to sort integer values of an array. Like quicksort, insertion sort, bubble sort and other sorting methods, heap sort is used to sort an unsorted list. When compared to other sorting methods heap sort

Sort program to sort a list of numbers in decendimg order Hi Friend, Try the following code: import java.util.*; class SortListInDescendingOrder{ public static void main(String[] args

Merge Sort in Java is used to sort integer values of an array. There are many methods to sort Java like bubble sort, insertion sort, selection sort, etc. In Merge sort unsorted values are divided into two equal parts