In this session, we will learn How to Find Largest Element in an Array using Java.
Here is the program:
package basics;
public class FindMaxElement {
public static void main(String[] args) {
int[] arr = {0,1,4,5,6,7,8,9,2,3};
int max = arr[0];
for (int i = 1; i LT arr.length; i++) {
if(max LT arr[i]){
max = arr[i];
}
}
System.out.println("the largest element is:"+max);
}
}
On this page of the site you can watch the video online Java Basics - Session - 9 - How to Find Largest Element in an Array using Java with a duration of hours minute second in good quality, which was uploaded by the user Khan's Tech Lab 11 July 2025, share the link with friends and acquaintances, this video has already been watched 11 times on youtube and it was liked by 2 viewers. Enjoy your viewing!