. The program to creates and run the following three threads. The first thread prints the letter 'a' 100 times. The second thread prints the letter 'b' 100 times. The third thread prints the integer 1 to 100.


class PrintChar implements Runnable {
private char charToPrint;
private int times;

PrintChar(char c, int t) {
    charToPrint = c;
    times = t;
}

public void run() {
    for (int i = 0; i < times; i++) {
        System.out.print(charToPrint);
    }
}

}

class PrintNumber implements Runnable {
private int n;

PrintNumber(int n) {
    this.n = n;
}

public void run() {
    for (int i = 1; i <= n; i++) {
        System.out.print(i + " ");
    }
}

}

public class Main {
public static void main(String[] args) {
// Create threads
Thread thread1 = new Thread(new PrintChar('a', 100));
Thread thread2 = new Thread(new PrintChar('b', 100));
Thread thread3 = new Thread(new PrintNumber(100));

    // Start threads
    thread1.start();
    thread2.start();
    thread3.start();
}

}