Thursday 4 January 2018

Flowable








//Print Method - 1
        Flowable.just("Hello RxJava").subscribe(line ->  System.out.println(line));
//Print Method - 2
        Flowable.just("Hello RxJava").subscribe(System.out::println);
        
Print Different Data Type

// String
        Flowable.just("Hello RxJava").subscribe(System.out::println);

// Int
        Flowable.just(55).subscribe(System.out::println);

// Double
        Flowable.just(49.63).subscribe(System.out::println);

// Char
        Flowable.just('A').subscribe(System.out::println);

// Boolean
        Flowable.just(false).subscribe(System.out::println);

// Array
        Flowable.just("one", "two", "three").subscribe(System.out::println);

// List
        List<String> list = new ArrayList<>();
        list.add("List-1");
        list.add("List-2");
        list.add("List-3");
        list.add("List-4");

        Flowable.just(list).subscribe(System.out::println);

No comments:

Post a Comment

Calling method Sequencely

1. Execute multiple task sequencly (WAY-1) ------------------------------------------------------------------------------ import io.re...