I try to make create multi dirs and files more easier with follwoing code:
package ro.ex;
class File {
public interface Lamb {
public void call(Class c);
}
public static void tap(Lamb l) {
l.call(File.class);
}
public static void mkdir(String path) {
}
public static void main(String[] args) {
File.tap((f) -> {
f.mkdir("dir");
f.mkdir("dir2");
});
}
}
but in f.mkdir("dir"), intellij idea raise can't resolve method 'mkdir'
my question is: how to change code to make code in main block work well
mkdircalls all pass aStringbut yourmkdirmethod doesn't take any parameters?