import java.util.Random; public class IndianPhoneNumberGenerator { public static void main(String[] args) { // Define a method to generate a random Indian phone number String phoneNumber = generateRandomIndianPhoneNumber(); // Print the generated phone number System.out.println("Random Indian Phone Number: " + phoneNumber); } public static String generateRandomIndianPhoneNumber() { Random rand = new Random(); // Indian phone numbers typically start with 7, 8, or 9, followed by 9 digits. // For example, 9876543210. // Generate the first digit (7, 8, or 9) int firstDigit = rand.nextInt(3) + 7; // Generate the remaining 9 digits StringBuilder phoneNumber = new StringBuilder(String.valueOf(firstDigit)); for (int i = 1; i < 10; i++) { phoneNumber.append(rand.nextInt(10)); } return phoneNumber.toString(); } }