Create a file: Difference between revisions

no edit summary
No edit summary
Line 2:
 
In this task, the job is to create a new empty file called "output.txt" with no content and of size 0 byte
and an empty directory called "docs". Assuming current directory or fullpath. Either "/output.txt" or "c:\\output.txt" for the former and "/docs/" or "c:\\docs\" for the second test.
 
==[[Java]]==
Line 30:
public static void main(String args[]) {
test("file", "output.txt");
iftest("file", File.seperatorCharseperator ==+ '/'"output.txt");
test("file", "/output.txt");
else
test("file", "c:\\output.txt");
 
test("directory", "docs");
iftest("directory", File.seperatorCharseperator ==+ '/'"docs" + File.seperator);
test("directory", "/docs/");
else
test("directory", "c:\\docs\\");
}
}
Anonymous user