I would like to access previous element from the reserved name "this" like that :
paper.lines.get(this-1);
Is there a way to do it simply?
I would like to access previous element from the reserved name "this" like that :
paper.lines.get(this-1);
Is there a way to do it simply?
If
this
is an element in the List and you want the elements located before it, you need :Of course this code lacks validations, since
this
may not be found in the List, or it may be the first element of the List. In both cases you'll get an exception.So, safer code would be: