If you're learning out of a book, a lot of times an author will use the same sketch over and over and add things to it along the way. The variable endY may have a different purpose later on, where you'll be initializing it to something else in the setup(), and so the author wants to keep things organized properly for the earlier stages. This may or may not be true, so take this comment in addition to what PhiLho said.
Let me also say this. Don't be too overly concerned with knowing the exact purpose of every little line of code when you're learning. You've obviously noticed that taking out that initialization in setup() doesn't affect your sketch. So that's part of learning right there, being observant on
how things affect your sketch and not necessarily
why things affect your sketch.
I used to try and learn programming languages by sitting down with a book and reading from cover to cover before I did any coding at all. I wanted to know everything there was about the language before I started coding. What a fool I was! This is the equivalent of trying to learn a foreign language by sitting down with a dictionary and just learning all the words. It's better to learn in context, kind of like learning a foreign language through immersion. You just get your feet wet, and figure out the details later. I'm experiencing this big time with the iPhone SDK right now. Objective-C is bizarre when you're coming from Java and C++, and it's a vast language, and it's really useless to try and learn all the details before you just start trying to make iPhone apps. Then as your needs change, you dig deeper to find the answer. It'll be the same with Processing. Sorry this is long-winded, but hope this helped in some way!