问题 填空题

下列程序的功能是显示用户在命令行方式下指定的任意驱动器目录,请补充程序。  import java.iO.*;  public class FindDirectories  {   public static void main (String args[ ])   {    if(args.length= =0)    args=new String[ ]".."};    try    {     File pathName=new File(args [0]);     String[]fileName=pathName.list( );     for(int i=0;<fileName.length;i+ +=     {      File f=new 【 】      if(f.isDirectory( ))      {      System.out.println(f.getCanonicalPath( ));      main(new String[ ]       {         f.getPath( )       });     }    }  =  catch(IOException e)   {   e.printStackTrace( );   }  = =

答案

参考答案:File(pathName.getPath( ),fileName[i])

解析:有以下两个语句都可以创建一个文件,其中构造方法的参数,可以是路径文件名,也可以是路径和文件名。  File Pathname = new File(arge[O]);//路径文件名来建立文件对象  File f=new File (pathname.getPath,fileName[i]);//(路径,文件名)  本题中,采用第二种方法来创建文件。

阅读理解

Need: Full-time secretary
Position( 职位 ) available
Applicants( 申请人 ) should have at least 2 years’ experience and be able to type 60 words a minute. No computer skills needed apply in person at United Business Ltd, 17 Broening Street, or Call at 427-882108.
Are you looking for a part-time job?
We need 3part-time shop assistants to work during the evening. No experience needed. Applicants should be between 18 and 26. Call at 366-765448 for more information.
3.  Do you have experience working on computers? Would you like a full-time position working in an exciting new company? If your answeris yes, give us a call at 457-896758
4.Part-time work available
We are looking for retired(退休的) adults who would like to work part time at tne weekend. Work includes answering the telephone and giving customers information. For more information contact us by calling at 345-674132.
小题1:Jane recently retired and is looking for a part-time position. She would like to work with people.The best job for Jane is       .
A. the shop assistant 
B. the computer trained secretary
C. the part-time work at the weekend
小题2:Kasia is 21 years old and would like a part-time position to help her pay university cost. She should call at      .
A. 345-674132  B. 366-765448  C. 457-896758
小题3:If Alice applies for the position at United Business Ltd, she needs     .
A. 2 years’ experience B. computer skills C. to work at the weekend
小题4:If Ann gets the job as a computer trained secretary, she’ll probably work       .
A. in a factory  B. in a shop  C. in a company
小题5:The four texts above are most probably       .
A. notices  B. advertisements  C. invitations
单项选择题 A1/A2型题