Java creating file with Google Guava

In this example, we create a new file with Google Guava library.
For the project we need the guava dependency:

public class JavaCreateFileExample {    
    public static void main(String[] args) throws IOException {
        Files.touch(new File("src/main/resources/myfile.txt"));
The new file is created with Files.touch(). It accepts a File as a parameter.

Free Spring Boot Tutorial - 5 Hours Full Course

Watch this course on YouTube at Spring Boot Tutorial | Fee 5 Hours Full Course