doc = Jsoup.connect("https://Сайт").maxBodySize(0).get(); content = doc.select("tr"); titleList.clear(); for (Element contents : content) { titleList.add(contents.text()); publishProgress(progress); } Closed due to the fact that the essence of the question is incomprehensible by the participants Enikeyschik , Igor , default locale , 0xdb , aleksandr barakin Jan 22 at 17:09 .
Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .
2 answers
Hmm, syntax feature. You have a list / container / array, and you need to go through its elements. You write for (current element: list), and thus, in each iteration of the loop, the variable standing before ":" takes the value of the next element from the specified after ":" container ..
- ":" - is the syntax that stands for division? - Dmitry
- @ Dmitriy In this case, this symbol simply separates the variable in which the next value from the container is written from the variable of the container itself. This is the syntax of the language, these are the rules .. - Alex Nem
- Well, under what condition will the for stop? - Dmitry
- @ Dmitry When it comes to the last element of the container, that is, when it goes through everything that is there .. - Alex Nem
- Many thanks, if you can easily look at this question! ru.stackoverflow.com/questions/933486/… - Dmitry
it is foreach , runs through the collection and takes one element in each iteration
contentarray, and for each of its elements, call a couple of commands in the loop body. - ߊߚߤߘ 8:49 pm