Write a Java program that identifies and print the third largest number from a given array.

As a Systems Engineer at Tata Consultancy Services, I deliver exceptional software products for mobile and web platforms, using agile methodologies and robust quality maintenance. I am experienced in performance testing, automation testing, API testing, and manual testing, with various tools and technologies such as Jmeter, Azure LoadTest, Selenium, Java, OOPS, Maven, TestNG, and Postman.
I have successfully developed and executed detailed test plans, test cases, and scripts for Android and web applications, ensuring high-quality standards and user satisfaction. I have also demonstrated my proficiency in manual REST API testing with Postman, as well as in end-to-end performance and automation testing using Jmeter and selenium with Java, TestNG and Maven. Additionally, I have utilized Azure DevOps for bug tracking and issue management.
import java.util.Arrays;
public class demo {
public static void main(String[] args) {
int[] arr = {8, 6, 9, 2, 1, 66, 54};
int arrLen = arr.length;
// logic to sort the array in ascending order
for(int i=0; i<arrLen-1; i++){
for(int j=i+1; j<arrLen; j++){
int temp = 0;
if(arr[i]>arr[j]){
temp = arr[j];
arr[j] = arr[i];
arr[i] = temp;
}
}
}
/*
// Logic to print the sorted array
for (int a : arr){
System.out.println(a);
}
*/
System.out.println("Third largest number in the array: " +arr[arrLen-3]);
}
}
/*
Third largest number in the array: 9
*/




