Question
import java.io.*;
class files {
public static void main(String args[]) {
File obj = new File("/java/system");
System.out.print(obj.getName());
}
}
What is the output of this program?
import java.io.*;
class files {
public static void main(String args[]) {
File obj = new File("/java/system");
System.out.print(obj.getName());
}
}
Answer: Option B
Was this answer helpful ?
obj.getName() returns the name of the file.
Was this answer helpful ?
Submit Solution