A. /var/home/user/
B. /var/config/saved/
C. /var/tmp/
D. /config/
第1题:
A.System.load("prop.custom");
B.System.getenv("prop.custom");
C.System.property("prop.custom");
D.System.getProperty("prop.custom");
E.System.getProperties().getProperty("prop.custom");
第2题:
A.Using’diagmenu’command,setfcs1toDefined.
B.Using’oem_setup_env’and’rmdev-R’commands,setfcs1adapterto’Defined’state.
C.Using’diagmenu’command,setthefcs1statetoDefined
D.Using’oem_setup_env’and’rmdev-dl’commands,setthestateoffcs1toDefined
第3题:
形装载形文件的命令是command状态下调用load命令。
第4题:
import java.io.*;
import java.util.*;
public class FileClass {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
try{
File file=new File(args[0]);
System.out.println(args[0]+"文件");
if(file.isFile()){
//是否为文件
System.out.print(file.canRead()?"可读":"不可读");
System.out.print(file.canWrite()?"可写":"不可写");
System.out.print(file.length()+"字节");//注意不能调用数组类型 File[] 的 length()例:File[] files=file.listFiles();不可以这么调用filess.length()
}
else{
//列出所有文件及目录
File[] files=file.listFiles();
ArrayList<File> fileList=new ArrayList<File>();
for(int i=0;i<files.length;i++){
//先列出目录
if(files[i].isDirectory()){
//是否为目录
//取得路径名
System.out.println("路径"+"[ "+files[i].getPath()+" ]");
}
else{
//文件先存入fileList,待会再列出
fileList.add(files[i]);
}
}
//列出文件
for(File f:fileList){
System.out.println(f.toString());
}
System.out.println();
}
}
catch(ArrayIndexOutOfBoundsException e){
System.out.println("using:java FileDemo pathname");
}
}
}
结果:using:java FileDemo pathname
是不是创建的对象所代表的文件没有被创建成功
File file=new File(args[0]); 就是创建一个args[0]所指文件路径的文件对象。出现异常的原因是:你把args[0]作为文件路径,而你运行时又没有指定。
第5题:
A.at apr 3 2PM command.file
B.at 2PM 3 apr command.file
C.at 2PM apr 3 command.file
D.at 3 apr 2PM command.file
第6题:
判断正误:形装载形文件的命令是command状态下调用load命令。