Possible Duplicate:
What trick does Java use to avoid spaces in >>?
In C++, nested parameters require extra spaces, so you see things like this:
List< List<String> >
In Java, no spaces are required, and it’s fine to write this:
List<List<String>>
You may use extra spaces if you prefer, but they’re not required. (In C++, a problem
arises because >>
without the space denotes the right-shift operator. Java fixes the
problem by a trick in the grammar.)
Can any body explain what is the trick used in java grammar to solve issue?
>
at that point that isn't the end of a generic declaration. I.e., Because you couldn't have something likeList<4 >> 1>
or whatever it's just a matter of checking the brackets match up until you're past the declaration.