Groovy: variable assignment
<p>I'm about to take a course in computer science and have some decent knowledge in T-SQL and that's it. </p>

<p>The pre reading for this course is not well written. Having trouble how they are getting certain result sets. Here is <code>Groovy</code> statement  </p>

<pre><code>String str
print "Please key in a word: "
str = System.console().readline() 
print "The word was: "
println str
</code></pre>

<p>Result </p>

<pre><code>Please key in a word: Tom
The word was : Tom
</code></pre>

<p>Where on earth did they assign or set <code>str = "Tom"</code>. I understand variables but have never come across <code>system.console().readLine()</code> so maybe i am missing something? 
Clearly the pre reading is meant to suggest that I type in value Tom but actually hasn't bothered to show me where. </p>

<p>Regards </p>

<p>Tom</p>