简体   繁体   中英

Kotlin code to java conversion

im new to kotlin and i confused what this code equivalent in Java. Heres the code

fun <T> retryCall(call: Observable<Response<T>>)

I tried convert it to java with kotlin tool and the result is this and i dont think this is the code im looking for

 void retryCall(@NotNull Observable var1);

Any help is appreciated

First of all, you only put Observable which is not the full type declared in the Kotlin code. So as a start, do this:

void retryCall(@NotNull Observable<Response<T>> var1);

But now you will get a compiler error about T . So we need to be sure this is a generic method like this:

<T> void retryCall(@NotNull Observable<Response<T>> var1);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM