1、选择题1:What will be the result of executing the following code? // Filename; SuperclassX.java package packageX; public class SuperclassX { protected void superclassMethodX() { } int superclassVarX; } // Filename SubclassY.
2、java 1.package packageX.packageY; 2. 3.public class SubclassY extends SuperclassX 4.{ 5.SuperclassX objX = new SubclassY(); 6.SubclassY objY = new SubclassY(); 7.void subclassMethodY() 8.{ 9.objY.superclassMethodX(); 10.int i;
5、ompilationerroratline9C.Runtimeexceptionatline11D.Noneofthese2:The following code is entire contents of a file called Example.java,causes precisely one error during compilation: class SubClass extends BaseClass{ } class BaseClass(){ String str; pub
6、lic BaseClass(){ System.out.println(“ok”);} public BaseClass(String s){ str=s;}} public class Example{ public void method(){ SubClass s=new SubClass(“hello”); BaseClass b=new BaseClass(“world”); } } Which line would be cause the error?
8、icvoidmethod(){SubClasss=newSubClass(“hello”);BaseClassb=newBaseClass(“world”);}}Whichlinewouldbecausetheerror?A.9B.10C.11D.123:鉴于Java的特点,它最适合的计算环境是A.并行计算环境B.分布式计算环境C.高强度计算环境D.开放式计算环境4:What will