I want to create a .java file but I'm doing something wrong as when I try to create it, I simply get a directory named example.java.
What I want to do is actually create a file with the extension .java
This is the snippet of my code which isn't working as wished:
new File(src, name + ".java").mkdir();
How can I implement as described above?
mkdirmeans "make directory".File#mkdirmethod is similar to themkdircommand in Windows and Unix/Linux: makes a dir.