PLEASE CAN ANYONE GIVE ME AN IDEA HOW TO FIN FIFTY BIGGEST NUMBER IN THE ARRAY.
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.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
PLEASE CAN ANYONE GIVE ME AN IDEA HOW TO FIN FIFTY BIGGEST NUMBER IN THE ARRAY.
Welcome to the Forum! Please read this topic to learn how to post code correctly and other useful tips for newcomers.
Please don't type in all caps, ever, unless maybe there's an elephant standing on your foot, then call another forum.
If I understand your question correctly, you want to write a program to find the maximum number in an array? Left alone, I have two approaches:
1. Use the sort method of the Arrays class from the java.util package and then pick up the last element from the array; or
2. Use the max method of the Collections class.
Your choice!
Who holds the KEY to all knowledge?
Sorting the array will allow you to get as many "biggest" numbers as you want.In case you want to get top 50 numbers from an array.