import java.util.ArrayList; import java.util.List; public class PrimeNumbersStartingWith5 { // Method to check if a number is prime public static boolean isPrime(int n) { if (n <= 1) return false; for (int i = 2; i <= Math.sqrt(n); i++) { if (n % i == 0) return false; } return true; } // Method to find all 3-digit prime numbers starting with 5 public static List findPrimesStartingWith5() { List primes = new ArrayList<>(); for (int num = 500; num < 600; num++) { if (isPrime(num)) { primes.add(num); } } return primes; } public static void main(String[] args) { List primes = findPrimesStartingWith5(); System.out.println("3-digit prime numbers starting with 5: " + primes); } }