PkgAccess2 类可编译。
由于第5 行发生错误编译失败。
由于第6 行发生错误编译失败。
由于第8 行发生错误编译失败。
第1题:
下列哪个选项的java源文件程序段是不正确的? ( )
A.package testpackage; public class Test{ }
B.import java.io.*; package testpackage; public class Test{ }
C.import java.i.*; class Person{} public class Test{ }
D.import java.io.*; import java.awt.*; public class Test { }
第2题:
Which will declare a method that is available to all members of the same package and be referenced without an instance of the class?()
第3题:
Which three demonstrate an “is a” relationship?()
第4题:
现有两个源文件: 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; } 下面哪两项是正确的?()
第5题:
package foo; public class Outer ( public static class Inner ( ) ) Which statement is true? ()
第6题:
现有: interface Data {public void load();} abstract class Info {public abstract void load();} 下列类定义中正确使用Data和Info的是哪项?()
第7题:
Which two demonstrate an “is a” relationship?()
第8题:
It can be any class.
No class has access to base.
The class must belong to the geometry package.
The class must be a subclass of the class Hypotenuse.
第9题:
import,package,public class
import必为首,其他不限
public class,package,import
package,import,public class
第10题:
x = 0
x = 42
Compilation fails because of an error in line 2 of class Test2.
Compilation fails because of an error in line 3 of class Test1.
Compilation fails because of an error in line 4 of class Test2.
第11题:
abstract public void methoda ();
public abstract double inethoda ();
static void methoda (double dl) {}
public native double methoda () {}
protected void methoda (double dl) {}
第12题:
1
2
3
4
第13题:
Which will declare a method that is available to all members of the same package and can be referenced without an instance of the class?()
第14题:
package test1; public class Test1 { static int x = 42; } package test2; public class Test2 extends test1.Test1 { public static void main(String[] args) { System.out.println(“x = “ + x); } } What is the result?()
第15题:
Which two allow the class Thing to be instantiated using new Thing()?
第16题:
一个源文件里只能有一个class用public修饰。
第17题:
package geometry; public class Hypotenuse { public InnerTriangle it = new InnerTriangle(); class InnerTriangle { public int base; public int height; } } Which is true about the class of an object that can reference the variable base? ()
第18题:
Which the two demonstrate an “is a” relationship?()
第19题:
public class Employee implements Info extends Data { public void load(){/*dosomething*/} }
public class Employee extends Inf.implements Data{ public void load() {/*do something*/} }
public class Empl.yee implements Inf extends Data{ public void Data.1oad(){* do something*/} public void load(){/*do something*/} }
public class Employee extends Inf implements Data { public void Data.1oad() {/*do something*/) public void info.1oad(){/*do something*/} }
第20题:
doX();
X.doX();
x.X.doX();
x.X myX=new x.X();myX.doX();
第21题:
An instance of the Inner class can be constructed with “new Outer.Inner ()”
An instance of the inner class cannot be constructed outside of package foo.
An instance of the inner class can only be constructed from within the outer class.
From within the package bar, an instance of the inner class can be constructed with “new inner()”
第22题:
any class
only the Target class
any class in the test package
any class that extends Target
第23题:
Compilation fails.
An instance of the Inner class can be constructed with “new Outer.Inner()”.
An instance of the Inner class cannot be constructed outside of package foo.
An instance of the Inner class can be constructed only from within the Outer class.
From within the package foo, and instance of the Inner class can be constructed with “new Inner()”.
第24题:
PkgAccess2 类可编译。
由于第5 行发生错误编译失败。
由于第6 行发生错误编译失败。
由于第8 行发生错误编译失败。