题目内容
(请给出正确答案)
[多选题]
给定如下Java代码:class Parent {protected void eat(){}}class Child extends Parent {_____
A.private
B.protected
C.static
D.public
答案
查看答案
A.private
B.protected
C.static
D.public
第1题
A.正确运行,输出:A
B.编译时发生错误
C.正确运行,输出:B
D.运行时引发异常
第2题
给定某Java程序的main方法,如下:
publicstaticvoidmain(String[]args){
System.out.print(“Hello”+args[1])
}
从命令行传参:peopleworldnation,该程序的运行结果是()。
A.Hellopeople
B.Helloworld
C.Hellopeopleworldnation
D.运行时出现异常
第3题
A.a
B.b
C.c
D.d
第4题
A.request.getSession().getParameter(“ID”,id)
B.request.getSession().getAttribute(“ID”,id)
C.request.getSession().setAttribute(“ID”,id)
D.request.getSession().setParameter(“ID”,id)
第10题
A.Stringstr=“123”
B.Stringstr=‘1’
C.Stringstr=newString(“123”)
D.Stringstr=newString()