Java程序员考试-JDK1.1-样题
以下试题可帮您了解考试310-022 (ibm考生为310-023)的题型。
which code fragments would correctly identify the number of arguments passed via the command line to a java™ application, excluding the name of the class that is being invoked?
int count = args.length;
int count = args.length - 1;
int count = 0;
while (args[count] != null)
count ++;
int count=0;
while (!(args[count].equals('')))
count ++;
which are keywords in java?
sizeof
abstract
native
null
boolean
which are correct class declarations? assume in each case that the text constitutes the entire contents of a file called fred.java on a system with a case-significant file system.
public class fred {
public int x = 0;
public fred (int x) {
this.x = x;
}
}
public class fred
public int x = 0;
public fred (int x) {
this.x = x;
}
}
public class fred extends mybaseclass, myotherbaseclass {
public int x = 0;
public fred (int xval) {
x = xval;
}
}
protected class fred {
private int x = 0;
private fred (int xval) {
x = xval;
}
}