Definition
Type of way to Print data
------------------------------------------
/** TYPE-1 */
Observable.just("One").subscribe(value -> System.out.println(value));
/** TYPE-2 */
Observable.just("Two").subscribe(System.out::println);
/** TYPE-3 */
Observable.just("Three").subscribe(value -> {
System.out.println(value);
});
Basic Example
1. Print simple data
// 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");
22
No comments:
Post a Comment