Computer Science, asked by sdadagg1848, 1 year ago

Which one of the options gets the name of the parent directory file one ) string name= file.getparentname("file.txt");string name= (new file("file.txt")).getparent();string name = (new file("file.txt")).getparentname();string name= (new file("file.txt")).getparentfile();?

Answers

Answered by rsumit027gmailcom
0
24-Sep-2010 · getParentName(“file.txt”); B. String name= (new File(“file.txt”)).getParent(); C. String name = (new File(“file.txt”)). getParentName(); D. String name ...
Answered by pragyakirti12345
1

Answer: string name = (new file("file.txt")).getparent();

Explanation:

string name = (new file("file.txt")).getparent();

This is the correct format.

getparent() method returns  the immediate parent of the file directory.

#SPJ2

Similar questions