Menu
Coddy logo textTech

Practice #1

Lesson 9 of 11 in Coddy's File Handling in Java course.

Let's practice!

challenge icon

Challenge

Easy

Create a function named printFile that gets a filename and prints the file content.

If the file does not exist, output:

File does not exist.

Don't forget to add the needed imports!

Try it yourself

class PrintFile {
    public static void printFile(String filename) {
        // Write code here
    }
}

All lessons in File Handling in Java