Sorting Program

Ads
 

Sorting Program

To sort 10items in alphabetical order

View Answers

February 12, 2012 at 8:58 PM

Arrays.sort(name of ur array)


February 13, 2012 at 11:35 AM

import java.util.*;

class ArrayExample{

    public static void main(String[] args) {
        String array[]=new String[5];
        Scanner input = new Scanner(System.in);
        System.out.println("Enter strings: ");
        for(int i=0;i<array.length;i++){
        array[i]=input.next();
        }
        Arrays.sort(array);
        for(int i=0;i<array.length;i++){
          System.out.println(array[i]);
        }
    }
}

Ads









Related Tutorials/Questions & Answers:
Sorting Program
Sorting Program  To sort 10items in alphabetical order   Arrays.sort(name of ur array)   import java.util.*; class ArrayExample{ public static void main(String[] args) { String array[]=new
sorting
sorting   write a program to arrange sorting in rows,column and diagonal
Advertisements
sorting
sorting  write to a program to arrange the sorting in rows, column and digonal
Sorting
Sorting  can any help me know which sorting algorithm java uses for sorting collection and arrays
sorting
sorting  how to do sorting without using bubble sort,selection sort
sorting
sorting  write a program which sort by lastname if the string of list is "firstnamelastname" i)66aa,cckk,ddac
Sorting in Java
Sorting in Java  Sorting in Java
group by sorting
group by sorting  group by sorting of data in SQL
ModuleNotFoundError: No module named 'sorting'
ModuleNotFoundError: No module named 'sorting'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'sorting' How to remove the ModuleNotFoundError: No module named 'sorting
Sorting and Searching
Sorting and Searching  Hi i would really be thankful if someone could help me with this A program is required to ask users to rate the Java... by entering -1. After all the votes have been counted, the program should output
Sorting an ArrayList
Sorting an ArrayList  print("code sample");Hello All, I am working on a program for school and I am having trouble with sorting my list... really new at Java...This is only the second program I am writing for school
linear sorting
linear sorting  what is linear sorting? can any send me an example   Hi Friend, Try this: import java.util.*; class ArraySort{ public...("After Sorting: "); for(int i=0;i<arr.length;i++){ System.out.println
sorting and storing data
sorting and storing data   sorting and storing data in UITableView
ModuleNotFoundError: No module named 'django-sorting'
ModuleNotFoundError: No module named 'django-sorting'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'django-sorting' How to remove the ModuleNotFoundError: No module named
ModuleNotFoundError: No module named 'falcon-sorting'
ModuleNotFoundError: No module named 'falcon-sorting'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'falcon-sorting' How to remove the ModuleNotFoundError: No module named
ModuleNotFoundError: No module named 'falcon-sorting'
ModuleNotFoundError: No module named 'falcon-sorting'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'falcon-sorting' How to remove the ModuleNotFoundError: No module named
ModuleNotFoundError: No module named 'file-sorting'
ModuleNotFoundError: No module named 'file-sorting'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'file-sorting' How to remove the ModuleNotFoundError: No module named '
ModuleNotFoundError: No module named 'file-sorting'
ModuleNotFoundError: No module named 'file-sorting'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'file-sorting' How to remove the ModuleNotFoundError: No module named '
ModuleNotFoundError: No module named 'hmcc-sorting'
ModuleNotFoundError: No module named 'hmcc-sorting'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'hmcc-sorting' How to remove the ModuleNotFoundError: No module named '
ModuleNotFoundError: No module named 'ranking-sorting'
ModuleNotFoundError: No module named 'ranking-sorting'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'ranking-sorting' How to remove the ModuleNotFoundError: No module named
ModuleNotFoundError: No module named 'sorting-algorithms'
ModuleNotFoundError: No module named 'sorting-algorithms'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'sorting-algorithms' How to remove the ModuleNotFoundError: No module
ModuleNotFoundError: No module named 'sorting-anton'
ModuleNotFoundError: No module named 'sorting-anton'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'sorting-anton' How to remove the ModuleNotFoundError: No module named
ModuleNotFoundError: No module named 'sorting-asmaa'
ModuleNotFoundError: No module named 'sorting-asmaa'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'sorting-asmaa' How to remove the ModuleNotFoundError: No module named
ModuleNotFoundError: No module named 'sorting-for-web'
ModuleNotFoundError: No module named 'sorting-for-web'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'sorting-for-web' How to remove the ModuleNotFoundError: No module named
ModuleNotFoundError: No module named 'sorting-hat'
ModuleNotFoundError: No module named 'sorting-hat'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'sorting-hat' How to remove the ModuleNotFoundError: No module named '
ModuleNotFoundError: No module named 'sorting-limo'
ModuleNotFoundError: No module named 'sorting-limo'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'sorting-limo' How to remove the ModuleNotFoundError: No module named '
ModuleNotFoundError: No module named 'sorting-ms'
ModuleNotFoundError: No module named 'sorting-ms'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'sorting-ms' How to remove the ModuleNotFoundError: No module named '
ModuleNotFoundError: No module named 'sorting-srabah'
ModuleNotFoundError: No module named 'sorting-srabah'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'sorting-srabah' How to remove the ModuleNotFoundError: No module named
ModuleNotFoundError: No module named 'sorting-with-linus'
ModuleNotFoundError: No module named 'sorting-with-linus'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'sorting-with-linus' How to remove the ModuleNotFoundError: No module
Sorting the array
Sorting the array  Implement a program to process votes for 5 candidates in a talent contest. The program should use a String array to hold the names... is not in the required range. At the end of voting, the program should sort
sorting numbers
sorting numbers  How to sort the numbers in ascending order   import java.util.*; class SortNumbers{ public static void main(String[] args) { Scanner input=new Scanner(System.in

Ads