Java Generics - What is this syntax for?

后端 未结 3 2003
误落风尘
误落风尘 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:11

    AsyncTask is a generic class. You should look at the generics tutorial to understand the syntax and semantics of generics.

    If you look at the AsyncTask docs you will see what each of those parameters means.

    • The first is marked as "params" and is the type that your doInBackground method accepts.
    • The second is the type that is used to denote progress, as taken in the onProgressUpdate method.
    • The third is the resulting type of the task, the type that is returned from doInBackground and received by onPostExecute.

提交回复
热议问题