This question is an exact duplicate of:
What does <> (angle brackets) mean in Java?
I am reading about AsyncTask
in Android. I have this example code:
private class DownloadFilesTask extends AsyncTask<URL, Integer, Long> {
protected Long doInBackground(URL... urls) {
int count = urls.length;
long totalSize = 0;
for (int i = 0; i < count; i++) {
totalSize += Downloader.downloadFile(urls[i]);
publishProgress((int) ((i / (float) count) * 100));
}
return totalSize;
}
protected void onProgressUpdate(Integer... progress) {
setProgressPercent(progress[0]);
}
protected void onPostExecute(Long result) {
showDialog("Downloaded " + result + " bytes");
}
}
And it is supposed to be called with:
new DownloadFilesTask().execute(url1, url2, url3);
I can't understand what <URL, Integer, Long>
means. I have seen them in some other classes like String<>
but I don't know what is the purpose of them.