fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. class Ideone {
  6. public static void main(String[] args) throws java.lang.Exception {
  7.  
  8. int array[] = {1, 2, 3, 4, 5};
  9. int large = big.findLargestNumber(array);
  10. System.out.print(large);
  11. }
  12. }
  13.  
  14. class big {
  15.  
  16. public static int findLargestNumber(int[] a) {
  17. int temp = a[0];
  18. for (int i = 0; i < a.length; i++) {
  19. if (a[i] > temp) {
  20. temp = a[i];
  21. }
  22. }
  23. return temp;
  24. }
  25. }
Success #stdin #stdout 0.1s 54660KB
stdin
Standard input is empty
stdout
5