Writing a thread for printing numbers

Report a typo

Write a class named NumbersThread that extends the Thread class. The class must have a constructor that takes two integer numbers from and to as range borders.

Implement the method run. It must print all numbers from the given range (inclusive) to the standard output.

Use the provided template.

Sample Input 1:

1 3

Sample Output 1:

1
2
3

Sample Input 2:

2 2

Sample Output 2:

2
Write a program in Java 17
class NumbersThread extends Thread {

public NumbersThread(int from, int to) {
// implement the constructor
}

// you should override some method here
}
___

Create a free account to access the full topic