Share on Google+Share on Google+

Supriya Kurian
number sorting
1 Answer(s)      6 years and 4 months ago
Posted in : Java Beginners

program to sort a list of numbers in descending order where the inputs are entered from keyboard in runtime


View Answers

December 9, 2010 at 11:04 AM

Hi Friend,

Try the following code:

import java.util.*;
class SortListInDescendingOrder{
    public static void main(String[] args) 
        Scanner input=new Scanner(;
        System.out.println("Enter List Elements: ");
        ArrayList<Integer> list=new ArrayList<Integer>();
        for(int i=0;i<5;i++){
        int num=input.nextInt();
        System.out.println("List Elements in descending order");
        for(int i=0;i<list.size();i++){


Related Tutorials/Questions & Answers:
number sorting
number sorting  program to sort a list of numbers in descending order where the inputs are entered from keyboard in runtime   Hi Friend, Try the following code: import java.util.*; class SortListInDescendingOrder
sorting   write a program to arrange sorting in rows,column and diagonal
Sorting  can any help me know which sorting algorithm java uses for sorting collection and arrays
sorting  write to a program to arrange the sorting in rows, column and digonal
sorting  how to do sorting without using bubble sort,selection sort
Sorting in Java
Sorting in Java  Sorting in Java
group by sorting
group by sorting  group by sorting of data in SQL
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 programming language using a number in the range 0 - 10. The data input is ended
Sorting the array
Sorting the array  Implement a program to process votes for 5... of the 5 candidates and an integer array to record the number of votes for each contestant. It should prompt the user to enter the number of the candidate
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 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(
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
Java sorting
sorting mechanism. say about Collections.Sort() & Arrays.Sort() that uses
sorting and storing data
sorting and storing data   sorting and storing data in UITableView
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. The numbers I receive in my output are correct, but not in ascending order as required
Bubble Sorting in Java
Bubble Sorting in Java  Hi, What is Bubble Sorting? Guide me where to learn Bubble Sorting in Java? Thanks   Hi, Check the tutorial at Bubble Sorting in Java. Thanks
Java Sorting
array to record the number of votes for each contestant.   import
Sorting in java - Java Beginners
Sorting in java  Hello.. I want you to help me with this question.. 1. A statistics company wants to keep information of families. The information of a family is the family name, the number of members and first name of each
sorting Line in c
sorting Line in c  Hi I need help with sorting line in programming c asking user to enter 1-10 characters and then sort them in lower case, alphabetical and ascending order. Any help will be appreciated! please help! void
Imp-HTML Table Sorting
Imp-HTML Table Sorting   Hi, I am working on a project and as per requirement from client i have to sort a table based on the ID Column. I want... of HTML table sorting where sorting happenes whenever user clicks on column header
Sorting along life span
Sorting along life span  how to find total age in date of birth and date of death.and also sort along life span.using object class and collection API
What are the different functions in sorting an array?
What are the different functions in sorting an array?  What are the different functions in sorting an array
sorting array in java
sorting array in java  How to sort array in Java or JavaScript?   JavaScript Sorting array tutorial   Java Sort array of strings import java.util.*; class ArrayExample{ public static void main(String
Array Sorting - Development process
Array Sorting  Hello sir, Now i m doing various Array sorting(Bubble,insertion,Quick,merge etc ) I want to display Array Sort in steps by step like... is the code to display array sorting with moving graphics(color)in steps
sorting folders automatically
sorting folders automatically  i want to sort folders automatically,let say the folders to be displayed in a webpage(hyperlinked to its resource).the page should display only the folder that belongs to last 15 should
Sorting the letters in a String
Sorting the letters in a String  I have recently learned how to sort different strings using the insertion sort method but I still cannot sort the letters in one particular string. For instance, if I enter in the string "Hello my
Sorting algorithms - Java Beginners
Sorting algorithms  I'v being given an assignment and I still couldn't find a proper answer for the following questions.Can anyone pls pls help me wi it? 1)Compare and contrast efficiencies of Shell,Quick,Heap and Radix sort
Sorting Router Interface in a list.
Sorting Router Interface in a list.  Hi All, I have list which contains router interface as GigabitEthernet 1/0, GigabitEthernet 1/1,GigabitEthernet..., GigabitEthernet 1/11 How can i achieve this type of sorting in java. It's really urgent
Java Spring Hibernate Struts Training Retrieve database from the table dynamically in jsp from oracle using servlet What does core Java include? java What are some way to learn Java quickly? Is it required to learn Java before learning Java Script? Is it necessary to learn java script before learning PHP? Are HTML5 and Java Script boosts Java career? Is Java object oriented? Fingerprint application with Java Uninstall Oracle Virtual Box JSON to HashMap Free Java online Training I want example of Control Statement in Java ANSI Color Codes with Python Create a Program that Calculates Input What is difference between JDK,JRE and JVM? How to see ubuntu version on server? How to get Page Source in Selenium (WebDriver) using Java? The path to the driver executable must be set by the webdriver.gecko.driver system property parse data from a link in java Java Program Qns using BlueJ How to fix HAX Kernel Module Is Not Installed error? Installing Audacity Looking for code Logic to check track changes & Coments in MSWord, MSWordx, MSExcel, MSExcelx is ON/OFF Installing JDK on Mac SAX Parser exception ERROR 601 (42P00): Syntax error. Encountered Thread java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileItemFactory How to install Ubuntu 16.04 LTS? HttpServletRequest cannot be resolved to a type in eclipse - Solved Unhandled event loop exception GC overhead limit exceeded Spring Data jpa with apache phoenix Caused by: java.lang.IllegalArgumentException: Not a host:port pair: PBUF o.a.h.h.z.RecoverableZooKeeper - Possibly transient ZooKeeper, quorum= com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager class not found com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager not found How to download and install Java 8 on Windows? How to uninstall JDK 7? How to install gtk-doc-tools package in Ubuntu? How to install Oracle JDK 8 on Ubuntu? ejabberd_ctl.beam not found - Solved How to convert date to UTC format in Java? How to install autoconf, automake and libtool in Ubuntu 15.10? How to convert current date to mm dd yyyy format in Java? How to convert current date to dd mm yyyy format in Java? How to stop window closing in "internalFrameClosing" event. How to find list of all index in Neo4j? file location SASLError using PLAIN: not-authorized


Advertisement null