#need help about a loop
1 messages · Page 1 of 1 (latest)
Detected code, here are some useful tools:
<@&987246399047479336> please have a look, thanks.
While you are waiting for getting help, here are some tips to improve your experience:
If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.
Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.
Well the person : persons is just a loop over the list of persons. Easier way than writing it with int i = 0; i< persons.size... It's called forEach Loop. Downside: you don't have the index in the loop. But most of the time you dont need that.
the part inside the loop is pretty dumb though, it doesnt do anything
like this part here person.HelloWorld;
makes no sense
Yes it would not compile. As it's not a method call without ()
Or at least it would do nothing
it does compile
if its a field
but it doesnt do anything besides accessing it and not using it for anything
but yeah
It doesn't compile... since it's a field 🙂