public static void main(String[] args){ makeDir(args[0],args[1]);
} }
/* Look at your java reference for createNewFile(). Notice that it throws an IOException. You need to catch it.
createNewFile public boolean createNewFile() throws IOException
Another option is to throw it yourself.
public class FileTest throws IOException { static void makeDir(String parent,String child){ File f=new File(parent); f.mkdirs(); File subf=new File(parent,child);
subf.createNewFile();
}
I wouldn't do that here though. If FileTest were outside of the main .. say you had multiple classes .. then this would be okay with a try catch in the constructor or method that calls the FileTest object.