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



相关文章


SCJP考试辅导第二章:if语句和switch语句
JBoss与Sun的Java标准之争日趋严重
JavaIDE漫谈(-)——VAJ之后是什么?
JAVA题库:格林模拟试题二(上)(4)
JAVA题库:格林模拟试题二(上)(3)
技巧心得:SCJP考试心得集
Sun让软件没有国界
JAVA题库:格林模拟试题二(上)(6)
【Java入门】如何掌握Java(J2EE篇)
澳大利亚华人论坛
考好网
日本华人论坛
华人移民留学论坛
英国华人论坛