JAVA题库:格林模拟试题二(上)(3)
文章作者 100test 发表时间 2007:03:14 17:06:04
来源 100Test.Com百考试题网
question 7)
what will happen when you attempt to compile and run this code?
public class mod{
public static void main(string argv[]){
}
public static native void amethod().
}
1) error at compilation: native method cannot be static
2) error at compilation native method must return value
3) compilation but error at run time unless you have made code containing native amethod available
4) compilation and execution without error
question 8)
what will happen when you attempt to compile and run this code?
private class base{}
public class vis{
transient int ival.
public static void main(string elephant[]){
}
}
1)compile time error: base cannot be private
2)compile time error indicating that an integer cannot be transient
3)compile time error transient not a data type
4)compile time error malformed main method