We have already covered a few factories to create Observable sources, including Observable.create(), Observable.just(), and Observable.fromIterable(). After our detour discussing observers, let's pick up where we left off and cover a few more Observable factories.
Other Observable sources
Observable.range()
Observable.range() creates an Observable that emits a consecutive range of integers. It emits each number from a start value and increments each subsequent value by one until the specified count is reached. These numbers are all passed through the onNext() event, followed by the onComplete() event:
import io.reactivex.rxjava3.core.Observable;
public class Ch2_15 {
public static void main(String[] args) {
Observable...