Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Sorting BigInteger Arrays

  1. #1
    Junior Member
    Join Date
    Mar 2014
    Thanked 0 Times in 0 Posts

    Default Sorting BigInteger Arrays

    Hello all. I am currently working on Project Euler problem 29, which involves me needing a BigInteger array and sorting it somehow. I have been able to do

    * Array.sort(arrayname); *

    in past codes, but Eclipse is telling me that I can't do this with my BigInteger array. Is there any reason for this? And is there a way to get around it or fix it? Thank you!

    EDIT: I have already imported java.util.Arrays

  2. #2
    Join Date
    Oct 2013
    Manila, Philippines
    My Mood
    Thanked 64 Times in 61 Posts

    Default Re: Sorting BigInteger Arrays

    Instead of Array, you can use collections. and use the sort method of collections.
    By the way, I used double in that problem, and it works fine.

    --- updated ---
    Correction. There is a sort method for array, sort(array, Comparator) just create a new Object of Comparator for sorting
    Last edited by dicdic; March 23rd, 2014 at 11:29 PM.

  3. The Following User Says Thank You to dicdic For This Useful Post:

    GregBrannon (March 24th, 2014)

Similar Threads

  1. Sorting parallel arrays
    By dynasty in forum What's Wrong With My Code?
    Replies: 3
    Last Post: March 27th, 2013, 07:23 AM
  2. Replies: 10
    Last Post: March 26th, 2013, 04:46 PM
  3. Arrays sorting
    By LeeDD in forum What's Wrong With My Code?
    Replies: 13
    Last Post: March 4th, 2013, 03:17 PM
  4. Need helpt with sorting arrays?
    By xion0374 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: March 19th, 2012, 06:00 PM
  5. Sorting Arrays
    By Bryan29 in forum Collections and Generics
    Replies: 5
    Last Post: November 28th, 2011, 07:21 AM