The Artima Developer Community
Sponsored Link

Java Buzz Forum
How to Find Largest and Smallest Number in an Array in Java

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Javin Paul

Posts: 1090
Nickname: javinpaul
Registered: Jan, 2012

Javin Paul is Java Programmer working on Finance domain.
How to Find Largest and Smallest Number in an Array in Java Posted: Feb 10, 2014 5:10 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Javin Paul.
Original Post: How to Find Largest and Smallest Number in an Array in Java
Feed Title: Java67
Feed URL: http://www.java67.com/feeds/posts/default?alt=rss
Feed Description: Java and technology tutorials, tips, questions for all programmers.
Latest Java Buzz Posts
Latest Java Buzz Posts by Javin Paul
Latest Posts From Java67

Advertisement
Understanding of arrays are very important for any programmer and to develop this understanding there are lots of programming exercise beginners can do. One of them is write a program to find smallest and largest number in an integer array. Java programmers are no different than others, so they can do this program in Java, not just to understand array but also relational operators available in Java. In this program, you need to write a method, yes we call function a method in Java, which will accept an integer array and then print largest and smallest number from that array. Use of any third-party library or API method is not allowed, which means you need to do this exercise by using basic tools of Java programming language, which includes operators, control statements,  keyword and some classes from java.lang package. This problem is also known as finding maximum and minimum numbers in a array, and technique mentioned here can be used in any other programming language as well. As a bonus point, you can also write JUnit test cases to test your method, I have not done so and relied on simple main method to test my code to show the output and keep it short, essential for any example or demo.
Read more »

Read: How to Find Largest and Smallest Number in an Array in Java

Topic: Android: location based services Previous Topic   Next Topic Topic: Access private fields in unit tests

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use