题目内容
(请给出正确答案)
[多选题]
给定如下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
A.正确运行,输出:A
B.编译时发生错误
C.正确运行,输出:B
D.运行时引发异常
给定某Java程序的main方法,如下:
publicstaticvoidmain(String[]args){
System.out.print(“Hello”+args[1])
}
从命令行传参:peopleworldnation,该程序的运行结果是()。
A.Hellopeople
B.Helloworld
C.Hellopeopleworldnation
D.运行时出现异常
A.a
B.b
C.c
D.d
A.request.getSession().getParameter(“ID”,id)
B.request.getSession().getAttribute(“ID”,id)
C.request.getSession().setAttribute(“ID”,id)
D.request.getSession().setParameter(“ID”,id)
A.Stringstr=“123”
B.Stringstr=‘1’
C.Stringstr=newString(“123”)
D.Stringstr=newString()