-
What is the output of this program?
import java.io.*;
public class files_Example
{
public static void main(String args[])
{
File object = new File("/new folder/system");
System.out.print(object.getName());
}
}
-
- new folder
- new folder/system
- /new folder/system
- system
- None of these
Correct Option: D
obj.getName() returns the name of the file.