JetBrains Academy: Files - Kamil-Jankowski/Learning-JAVA GitHub Wiki

JetBrains Academy: Files

Are siblings?:

Implement the method areSiblings that checks if the files have same parent.

It should take two files and return true if the files have the same parent and false otherwise.

public boolean areSiblings(File f1, File f2) {
    return f1.getParent().equals(f2.getParent()) ? true : false;
}