groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mauro Sanna <mrsan...@gmail.com>
Subject what's the difference?
Date Fri, 07 Aug 2015 10:53:26 GMT
It's not clear to me what's the difference between:

file1.eachLine() { println it }

and

file1.withReader { reader ->
    while ((line = reader.readLine()) != null) {
        println line
    }
}

the output is the same.
Thank you.

Mime
View raw message