多项选择题
现有包结构:
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; }
哪两行分别插入后可允许代码编译?()
A.package com.;
B.import com.x;
C.package com.x;
D.import com.x.Alpha;
相关考题
-
多项选择题
现有两个源文件: package com.sun; public class PkgAccess { public static int tiger = 1414; } 和 import com.sun.PkgAccess; public class PkgAccess2 { int x1 = PkgAccess.tiger; int x2 = tiger; int x3 = com.sun.PkgAccess.tiger; int x4 = sun.PkgAccess.tiger; } 下面哪两项是正确的?()
A.PkgAccess2 类可编译。
B.由于第5 行发生错误编译失败。
C.由于第6 行发生错误编译失败。
D.由于第8 行发生错误编译失败。 -
多项选择题
以下关于JavaHotSpot的描述,哪两项正确?()
A.Java HotSpot 是一种热编译技术,在编译Java 源程序时会被使用
B.Java HotSpot 是一种热编译技术,在运行Java 代码时会被使用
C.Java HotSpot 是一种热编译技术,它会对程序的全部字节码进行优化
D.Java HotSpot 是一种热编译技术,它只对程序的部分字节码进行优化 -
多项选择题
class Sock { String size; String color; public boolean equals(Object o) { Sock s = (Sock) o; return color.equals(s.color); } // insert code here } 哪两个满足 hashCode 的约定?()
A.public int hashCode() { return 343; }
B.public int hashCode() { return size.hashCode (); }
C.public int hashCode() { return color.hashCode (); }
D.public int hashCode() { return (int) (Math.random() * 1000);
