Missing parts

Report a typo

You need to copy the lines from one file to another. In the input, you get the names of the original file and of its copy.

Given the following code:

val scanner = Scanner({ 1 })
val inputName = scanner.nextLine()
val outputName = scanner.nextLine()

File(outputName).{ 2 }.{ 3 }
{
    for (line in File(inputName).readLines()) {
        if (line.{ 4 }) {
            it.{ 5 }(line)
        }
        it.newLine()
    }
}

Please match the numbers and the missing parts of the code.

Match the items from left and right columns
1
2
3
4
5
bufferedWriter()
isNotEmpty()
System.`in`
write
use
___

Create a free account to access the full topic