Write a java program to display each alphabet after 2 seconds between ‘a’ to ‘z’.
public class AlphabetDelay {
public static void main(String[] args) {
try {
for (char ch = 'a'; ch <= 'z'; ch++) {
System.out.println(ch);
// Pause for 2 seconds (2000 milliseconds)
Thread.sleep(2000);
}
} catch (InterruptedException e) {
System.out.println("Thread interrupted");
}
}
}