briefly, because from running the println statement in main(), it invokes call the q of type Q in the instance variable; class R inherits class Q, so it inherits variable("r") of type R in class Q. THEN, variable("r") of type R goes through what class R offers to use, now back to the q of type Q AGAIN.
this runs and runs in a loop, until your pc blows up (not physically, mentally only)
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com