Amazing technological breakthrough possible @S-Logix

Office Address

  • #5, First Floor, 4th Street Dr. Subbarayan Nagar Kodambakkam, Chennai-600 024 Landmark : Samiyar Madam
  • +91- 81240 01111

Social List

How to find biggest number in java?


This program finds the biggest number in an array of the integer. Array of Integer is sorted using sort method of Arrays class that sorts the elements in natural order (Integer-ascending order). As the sort method is static the input array is modified instead of creating new array. Hence the last element of the array gives the biggest number.

Sample Code
  • Filename:

import java.util.*;
class Biggest {
public static void main(String args[]) {
//Sorting Integer in natural order
int n[] = {40,20,99,65,74};
System.out.println("Sorted list of Integer");
for(int i:n) {
int l=n.length;
int biggestNumber = n[l-1];
System.out.println("Biggest number="+biggestNumber);


Find biggest number in java