Java Generics - What is this syntax for?

后端 未结 3 2006
误落风尘
误落风尘 2020-12-07 00:02

What does this part of the code below mean? I don\'t even know what this syntax is even called.

private class Downl         


        
3条回答
  •  暖寄归人
    2020-12-07 00:13

    AsyncTask
    

    Tells AsyncTask is described by 3 distinct types, String as first parameter, Void as second parameter and Bitmap as third parameter, when you use AsyncTask.

    This is called Generics in java, introduced from Java5 onwards. Please read this tutorial to understand more about Generics. Here is javadoc on how android AsyncTasktask uses generics.

    Update: From AsyncTask javadoc

    1) Params, the type of the parameters sent to the task upon execution.
    2) Progress, the type of the progress units published during the background computation.
    3) Result, the type of the result of the background computation.
    

提交回复
热议问题