单选题Which gets the name of the parent directory file “file.txt”?()A String name= File.getParentName(“file.txt”);B String name= (new File(“file.txt”)).getParent();C String name = (new File(“file.txt”)).getParentName();D String name= (new File(“file.txt”)).getParentFile();E Directory dir=(new File (“file.txt”)).getParentDir();  String name= dir.getName();

单选题
Which gets the name of the parent directory file “file.txt”?()
A

 String name= File.getParentName(“file.txt”);

B

 String name= (new File(“file.txt”)).getParent();

C

 String name = (new File(“file.txt”)).getParentName();

D

 String name= (new File(“file.txt”)).getParentFile();

E

 Directory dir=(new File (“file.txt”)).getParentDir();  String name= dir.getName();


参考解析

解析: 暂无解析

相关考题:

In a tree directory of a file system, relative path name can be used to find files for improving directory retrieval.To do this, which directory of the followings should be set up?A.parent directoryB.child directoryC.working directoryD.home directory

下列InputStream构造方法正确的是()。 A、InputStream in=new FileReader(“file.txt”)B、InputStream in=new FileInputStream(“file.txt”)C、InputStream in=new InputStreamFileReader (“file.txt”,“read”)D、FileInputStream in=new FileReader(new File(“file.txt”))

要想以读方式打开文件“D:\File.txt”,以下不能实现目的的语句是()。A、ifstreaminf("D:\\FilEtxt",ios::in);B、ifstreaminf("D:\\File.txt");C、ofstreaminf("D:\\File.txt",ios::out);D、fstreaminf("D:\\File.txt",ios::in|ios::out);

WhichtwoconstructanOutputSreamthatappendstothefile“file.txt”?() A.OutputStreamout=newFileOutputStream(“file.txt”);B.OutputStreamout=newFileOutputStream(“file.txt”,“append”);C.FileOutputStreamout=newFileOutputStream(“file.txt”,true);D.FileOutputStreamout=newFileOutputStream(newfile(“file.txt”));E.OutputStreamout=newFileOutputStream(newFile(“file.txt”)true);

Whatwritesthetext“”totheendofthefile“file.txt”?() A.OutputStreamout=newFileOutputStream(“file.txt”); Out.writeBytes(“/n”);B.OutputStreamos=newFileOutputStream(“file.txt”,true); DataOutputStreamout=newDataOutputStream(os);out.writeBytes(“/n”);C.OutputStreamos=newFileOutputStream(“file.txt”); DataOutputStreamout=newDataOutputStream(os);out.writeBytes(“/n”);D.OutputStreamos=newOutputStream(“file.txt”,true); DataOutputStreamout=newDataOutputStream(os);out.writeBytes(“/n”);

Whichgetsthenameoftheparentdirectoryfile“file.txt”?() A.Stringname=File.getParentName(“file.txt”);B.Stringname=(newFile(“file.txt”)).getParent();C.Stringname=(newFile(“file.txt”)).getParentName();D.Stringname=(newFile(“file.txt”)).getParentFile();E.Directorydir=(newFile(“file.txt”)).getParentDir();Stringname=dir.getName();

Whenperformingadatabaseduplication,whichduplicatedatabaseparameterwouldyousettoensurethattheonlineredologsarecreatedinthecorrectlocation?() A.log_file_name_convertB.convert_log_file_nameC.file_name_convert_logD.redo_log_file_name_convertE.logfile_convert_directory

Given that the current directory is empty, and that the user has read and write privileges to the current, and the following:Which statement is true?() A.Compilation fails.B.Nothing is added to the file system.C.Only a new file is created on the file system.D.Only a new directory is created on the file system.E.Both a new file and a new directory are created on the file system.

Given that the current directory is empty, and that the user has read and write permissions, and the following:Which statement is true?() A.Compilation fails.B.The file system has a new empty directory named dir.C.The file system has a new empty directory named newDir.D.The file system has a directory named dir, containing a file f1.txt.E.The file system has a directory named newDir, containing a file f1.txt.

对于如下程序:  #include    main( )  {    FILE *fp;    fp=fopen(“file.txt”,“w”);    fprintf(fp,“%s”,“xyz”);    fclose(fp);  }  若文件file.txt中原有的内容为good,则运行该程序以后,文件file.txt中的内容为()

Which file characteristic cannot be used in the Cisco IronPort Data Security policies?() A、 file typeB、 file sizeC、 file ageD、 file name

Which two construct an OutputSream that appends to the file “file.txt”? ()A、 OutputStream out=new FileOutputStream(“file.txt”);B、 OutputStream out=new FileOutputStream(“file.txt”, “append”);C、 FileOutputStream out=new FileOutputStream(“file.txt”, true);D、 FileOutputStream out=new FileOutputStream(new file(“file.txt”));E、 OutputStream out=new FileOutputStream(new File(“file.txt”)true);

为文件c:/java/example/file.txt建立File对象file1可以采用()语句序列。A、File file 1=new File(“c://java//example//file.txt”)B、String path=”c:/java/example/”Filefile1=newFile(path,”oldfile.txt”)C、File dir 1=new File(“c://java//example”)Filefile1=newFile(dir1,”oldfile.txt”)D、File file 1=new File(“c:/java//example/file.txt”)

Which of the following commands changes a file characteristic so that it cannot be seen with astandard directory query? ()A、attrib file.txt +hB、attrib file.txt +rC、ren file.txtD、attrib file.txt +s

Which determines if “prefs” is a directory and exists on the file system?()  A、 Boolean exists=Directory.exists (“prefs”);B、 Boolean exists=(new File(“prefs”)).isDir();C、 Boolean exists=(new Directory(“prefs”)).exists();D、 Boolean exists=(new File(“prefs”)).isDirectory();E、 Boolean exists=true;  Try{  Directory d = new Directory(“prefs”);  } catch (FileNotFoundException e) {  exists = false;  }

Which gets the name of the parent directory file “file.txt”?()A、 String name= File.getParentName(“file.txt”);B、 String name= (new File(“file.txt”)).getParent();C、 String name = (new File(“file.txt”)).getParentName();D、 String name= (new File(“file.txt”)).getParentFile();E、 Directory dir=(new File (“file.txt”)).getParentDir();  String name= dir.getName();

When performing a database duplication, which duplicate database parameter would you set to ensure that the online redo logs are created in the correct location?()  A、 log_file_name_convertB、 convert_log_file_nameC、 file_name_convert_logD、 redo_log_file_name_convertE、 logfile_convert_directory

单选题Given that file is a reference to a File object that represents a directory, which code fragments will succeed in obtaining a list of the entries in the directory?()AVector filelist = ((Directory) file).getList();BString[] filelist = file.directory();CEnumeration filelist = file.contents();DString[] filelist = file.list();EVector filelist = (new Directory(file)).files();

单选题Which gets the name of the parent directory file “file.txt”?()A String name= File.getParentName(“file.txt”);B String name= (new File(“file.txt”)).getParent();C String name = (new File(“file.txt”)).getParentName();D String name= (new File(“file.txt”)).getParentFile();E Directory dir=(new File (“file.txt”)).getParentDir();  String name= dir.getName();

多选题Which two create an InputStream and open file the “file.txt” for reading? ()AInputStream in=new FileReader(“file.txt”);BInputStream in=new FileInputStream(“file.txt”);CInputStream in=new InputStreamFileReader (“file.txt”, “read”);DFileInputStream in=new FileReader(new File(“file.txt”));EFileInputStream in=new FileInputStream(new File(“file.txt”));

填空题对于如下程序:  #include    main( )  {    FILE *fp;    fp=fopen(“file.txt”,“w”);    fprintf(fp,“%s”,“xyz”);    fclose(fp);  }  若文件file.txt中原有的内容为good,则运行该程序以后,文件file.txt中的内容为()

多选题In which situations will the ASM metadata backup help you recover the ASM disk in a disk group?()Awhen one or more file directory paths are accidentally deleted from an ASM disk groupBwhen one of the disks in a disk group is accidentaly unpluggedCwhen the data file on an ASM disk group gets corruptedDwhen one or more disks in an ASM disk group are lost

多选题创建一个向文件“file.txt”追加内容的输出流对象的语句有()。AFileOutputStream out=new FileOutputStream(“file.txt”,true);BOutputStream out=new FileOutputStream(“file.txt”,“append”);COutputStream out=new FileOutputStream(“file.txt”);DFileOutputStream out=new FileOutputStream(new file(“file.txt”));EOutputStream out=new FileOutputStream(new File(“file.txt”),true.;

单选题When performing a database duplication, which duplicate database parameter would you set to ensure that the online redo logs are created in the correct location?()A log_file_name_convertB convert_log_file_nameC file_name_convert_logD redo_log_file_name_convertE logfile_convert_directory

单选题Which file characteristic cannot be used in the Cisco IronPort Data Security policies?()A file typeB file sizeC file ageD file name

单选题What writes the text “ ” to the end of the file “file.txt”?()A OutputStream out= new FileOutputStream (“file.txt”);   Out.writeBytes (“ /n”);B OutputStream os= new FileOutputStream (“file.txt”, true);   DataOutputStream out = new DataOutputStream(os);  out.writeBytes (“ /n”);C OutputStream os= new FileOutputStream (“file.txt”);   DataOutputStream out = new DataOutputStream(os);  out.writeBytes (“ /n”);D OutputStream os= new OutputStream (“file.txt”, true);   DataOutputStream out = new DataOutputStream(os);  out.writeBytes (“ /n”);

单选题Given that the current directory is empty, and that the user has read and write privileges to the current directory, and the following: Which statement is true?()A Compilation fails.B Nothing is added to the file system.C Only a new file is created on the file system.D Only a new directory is created on the file system.E Both a new file and a new directory are created on the file system.

多选题为文件c:/java/example/file.txt建立File对象file1可以采用()语句序列。AFile file 1=new File(“c://java//example//file.txt”)BString path=”c:/java/example/”Filefile1=newFile(path,”oldfile.txt”)CFile dir 1=new File(“c://java//example”)Filefile1=newFile(dir1,”oldfile.txt”)DFile file 1=new File(“c:/java//example/file.txt”)