Read from STDIN in Groovy
print "What is your name? "Exmaple:
def name = System.in.newReader().readLine()
println "Your name is " + name
$ groovy hello.goovy
What is your name? Goyun
Your name is Goyun
print "What is your name? "Exmaple:
def name = System.in.newReader().readLine()
println "Your name is " + name
Comments
Post a Comment