File tree Expand file tree Collapse file tree 1 file changed +14
-9
lines changed Expand file tree Collapse file tree 1 file changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -11,15 +11,20 @@ You can find additional code examples in the `/src/examples` folders of each [la
1111### Java
1212
1313``` java
14- public static void hello(String . .. names) {
15- Observable . from(names). subscribe(new Action1<String > () {
16-
17- @Override
18- public void call (String s ) {
19- System . out. println(" Hello " + s + " !" );
20- }
14+ public static void hello(String . .. args) {
15+ Flowable . fromArray(args). subscribe(s - > System . out. println(" Hello " + s + " !" ));
16+ }
17+ ```
2118
22- });
19+ If your platform doesn't support Java 8 lambdas (yet), you have to create an inner class of ``` Consumer ``` manually:
20+ ``` java
21+ public static void hello(String . .. args) {
22+ Flowable . fromArray(args). subscribe(new Consumer<String > () {
23+ @Override
24+ public void accept (String s ) {
25+ System . out. println(" Hello " + s + " !" );
26+ }
27+ });
2328}
2429```
2530
@@ -397,4 +402,4 @@ myModifiedObservable = myObservable.onErrorResumeNext({ t ->
397402 Throwable myThrowable = myCustomizedThrowableCreator(t );
398403 return (Observable.error(myThrowable ));
399404});
400- ```
405+ ```
You can’t perform that action at this time.
0 commit comments