Alpha a = x;
Foo f = (Delta)x;
Foo f = (Alpha)x;
Beta b = (Beta)(Alpha)x;
第1题:
A.int foo() { /* more code here */ }
B.void foo() { /* more code here */ }
C.public void foo() { /* more code here */ }
D.private void foo() { /* more code here */ }
E.protected void foo() { /* more code here */ }
第2题:
如果类Alpha继承了类Beta,则类Alpha称为派生类,类Beta称为【 】类。
第3题:
10. class Foo { 11. static void alpha() { /* more code here */ } 12. void beta() { /* more code here */ } 13. } Which two are true?()
第4题:
现有如下包结构: com |-- x | |-- Alpha.class | | | |-- y | |-- Beta.class | |-- Gamma.class 和类: class Test { Alpha a; Beta b; Gamma c; } 哪三个必须加入到类 Test 中,以使其通过编译?()
第5题:
Given the JSP code: <% request.setAttribute("foo", "bar"); %>and the Classic tag handler code: 5. public int doStartTag() throws JspException { 6. // insert code here 7. // return int 8. } Assume there are no other "foo" attributes in the web application. Which invocation on the pageContextobject,inserted at line 6,assigns "bar" to the variable x?()
第6题:
10. interface Foo {} 11. class Alpha implements Foo {} 12. class Beta extends Alpha {} 13. class Delta extends Beta { 14. public static void main( String[] args) { 15. Beta x = new Beta(); 16. // insert code here 17. } 18. } Which code, inserted at line 16, will cause a java.lang.ClassCastException?()
第7题:
Alpha a = x;
Foo f= (Delta)x;
Foo f= (Alpha)x;
Beta b = (Beta)(Alpha)x;
第8题:
a2.m2();
((Beta)a2).m2();
((Alpha)a2).m2();
((Gamma)a2).m2();
第9题:
s.writeInt(x);
s.serialize(x);
s.writeObject(x);
s.defaultWriteObject();
第10题:
package y;
package com;
import com.x.*;
import com.x.y.*
第11题:
Alpha a=x;
Foo f=(Delta)x;
Foo f=(Alpha)x;
Beta b=(Beta)(Alpha)x;
第12题:
String x = (String) pageContext.getAttribute(foo)
String x = (String) pageContext.getRequestScope(foo)
It is NOT possible to access the pageContext object from within doStartTag
String x = (String) pageContext.getRequest().getAttribute(foo)
String x = (String) pageContext.getAttribute(foo, PageContext.ANY_SCOPE)
第13题:
A.Alpha a = x;
B.Foo f = (Delta)x;
C.Foo f = (Alpha)x;
D.Beta b = (Beta)(Alpha)x;
第14题:
现有如F包结构: com |一一X | |一一Alpha.class | | | |一一y I |一一Beta.class | |l-- Gamma.class 和类: class Test { Alpha a; Beta b; Gamma c; } 哪三个必须加入到类Test中,以使其通过编译?()
第15题:
现有包结构: com |-- x | |-- Alpha.class | | | |-- y | |-- Beta.class | |-- Gamma.class 和类: //insert code here import com.*; import com.x.y.*; class Test { Alpha a; Beta b; Gamma c; } 哪两行分别插入后可允许代码编译?()
第16题:
表达式re.split(’/.+’,’alpha.beta...gamma..delta’)的值为()。
第17题:
10. public class Foo implements java.io.Serializable { 11. private int x; 12. public int getX() { return x; } 12.publicFoo(int x){this.x=x; } 13. private void writeObject( ObjectOutputStream s) 14. throws IOException { 15. // insert code here 16. } 17. } Which code fragment, inserted at line 15, will allow Foo objects to be correctly serialized and deserialized?()
第18题:
interface Beta {} class Alpha implements Beta { String testIt() { return “Tested”; } } public class Main1 { static Beta getIt() { return new Alpha(); } public static void main( String[] args ) { Beta b = getIt(); System.out.println( b.testIt() ); } } What is the result?()
第19题:
Tested
Compilation fails.
The code runs with no output.
An exception is thrown at runtime.
第20题:
int foo() { /* more code here */ }
void foo() { /* more code here */ }
public void foo() { /* more code here */ }
private void foo() { /* more code here */ }
protected void foo() { /* more code here */ }
第21题:
package y;
package com;
import com.x.y.*;
import com.x.*;
第22题:
package com.;
import com.x;
package com.x;
import com.x.Alpha;
第23题:
Foo.beta() is a valid invocation of beta().
Foo.alpha() is a valid invocation of alpha().
Method beta() can directly call method alpha().
Method alpha() can directly call method beta().