更多"[单选题]有以下的类定义:class MyClass
{
public"的相关试题:
[单选题]编译并运行以下程序段的结果是:( )
Public class MyClass{
Final static int i;
MyClass(){i =0;}
Public static void main(String args[]){
System.out.println(i);
}
}
A.编译出错
B.null
C.1
D.0
[多选题] 设有类定义如下:
Class InOut{
String s= new String("Between");
Public void amethod(final int iArgs){
Int iam;
Class Bicycle{
Public void sayHello(){
//Here
}
}
}
Public void another(){
Int iOther;
}
}
以下哪些语句可以安排在 //Here 处 ?
A. System.out.println(s);
B. System.out.println(iOther);
C. System.out.println(iam);
D. System.out.println(iArgs);
[单选题] 设有类定义如下:
Class Base{
Public Base(int i){}
}
Public class MyOver extends Base{
Public static void main(String arg[]){
MyOver m = new MyOver(10);
}
MyOver(int i){
Super(i);
}
MyOver(String s, int i){
This(i);
//Here
}
}
以下哪条语句可以安排在 //Here 处 ?
A. MyOver m = new MyOver();
B. super();
C. this("Hello",10);
D. Base b = new Base(10);
[判断题]风险分类的核心定义,关注类定义为尽管债务人目前有能力偿还融资本息,但存在一些可能对偿还产生不利影响的因素。
A.正确
B.错误
[判断题]风险分类的核心定义,损失类定义为债务人无法足额偿还融资本息,即使执行担保、回购或差额补足等,也肯定要造成较大损失。
A.正确
B.错误
[判断题]风险分类的核心定义,可疑类定义为借款人的偿还能力出现,明显问题,完全依靠其正常营业收入无法足额偿还融资本息,即使执行担保、回购或差额补足等,也可能造成一定损失。
A.正确
B.错误
[判断题] 对于类定义的样式,其名称必须以(.)开始. ( )
A.正确
B.错误
[单选题]46. If Japan _____ its relation with that country it will have to find another supplier of raw materials.
A.precludes
B.terminates
C.partitions
D.expires
[单选题]在用关键字class定义的类中,以下叙述正确的是( )。
A.在类中,不作特别说明的数据成员均为私有类型
B.在类中,不作特别说明的数据成员均为公有类型
C.类成员的定义必须是成员变量定义在前,成员函数定义在后
D.类的成员定义必须放在类定义体内部
[单选题] 以下程序的调试结果为?
class Base{
public final void amethod(){
System.out.println("amethod");
}
}
public class Fin extends Base{
public static void main(String argv[]){
Base b = new Base();
b .amethod();
}
}
A.编译指示带有 final 方法的类自己必须定义为 final
B.编译指示不能继承含有 final 方法的类
C.运行错误,原因是 Base 类没有定义为 final 类
D.运行输出 amethod
[单选题]以下程序的调试结果为?
Public class Outer{
Public String name = "Outer";
Public static void main(String argv[]){
Inner i = new Inner();
I.showName();
}
Private class Inner{
String name =new String("Inner");
Void showName(){
System.out.println(name);
}
}
}
A.输出结果 Outer
B.输出结果 Inner
C.编译错误,因 Inner 类定义为私有访问
D.在创建 Inner 类实例的行出现编译错误
[判断题] ( )在候机楼里,“无行李柜台”的英文是“no checked baggage counter”。
A.正确
B.错误
[单选题]以下程序的编译和运行结果为?
Abstract class Base{
Abstract public void myfunc();
Public void another(){
System.out.println("Another method");
}
}
public class Abs extends Base{
public static void main(String argv[]){
Abs a = new Abs();
a .amethod();
}
public void myfunc(){
System.out.println("My Func");
}
public void amethod(){
myfunc();
}
}
A.输出结果为 My Func
B.编译指示 Base 类中无抽象方法
C.编译通过,但运行时指示 Base 类中无抽象方法
D.编译指示 Base 类中的 myfunc 方法无方法体,没谁会喜欢该方法。
[单选题] 以下程序调试结果为:
Public class Test {
Int m=5;
Public void some(int x) {
M=x;
}
Public static void main(String args []) {
New Demo().some(7);
}
}
Class Demo extends Test {
Int m=8;
Public void some(int x) {
Super.some(x);
System.out.println(m);
}
}
A.5
B. 8
C. 7
D.无任何输出
E.编译错误
[单选题]阅读以下代码,输出结果为()
class A
{
public:
virtual void a()=0;
virtual ~A(){}
};
class AA:public A
{
public:
void a()
{
cout<<"nihao 2\n";
}
~AA()
{
cout<<"delete AA \n";
}
};
class AAA:public AA
{
public:
void a()
{
cout<<"nihao 3 \n";
}
~AAA()
{
cout<<"delete AAA \n";
}
};
class B
{
public:
A *b(int kind)
{
if(kind == 1)
return new AA;
else
return new AAA;
}
~B()
{
cout<<"delete B\n";
}
};
int main()
{
B *bb = new B;
A *aa = bb->b(1);
aa->a();
aa = bb->b(2);
aa->a();
delete aa;
delete bb;
return 0;
}
A.
nihao2
nihao3
delete AA
delete AAA
delete B
B.
nihao3
nihao3
delete AAA
delete AA
delete B
C.
nihao2
nihao2
delete AAA
delete AA
delete B
D.
nihao2
nihao3
delete AAA
delete AA
delete B
[单选题]以下程序调试结果为:
Class Base{
Base(){
Int i = 100;
System.out.print (i);
}
}
Public class Pri extends Base{
Static int i = 200;
Public static void main(String argv[]){
Pri p = new Pri();
System.out.print(i);
}
}
A.编译错误
B.200
C. 100200
D. 100
[单选题] 在Java中,以下程序编译运行后的输出结果为( )。
Public class Test {
Int x, y;
Test(int x, int y) {
This.x = x;
This.y = y;
}
Public static void main(String[] args) {
Test pt1, pt2;
Pt1 = new Test(3, 3);
Pt2 = new Test(4, 4);
System.out.print(pt1.x + pt2.x);
}
}
A. 6
B. 3 4
C. 8
D. 7
[多选题]设有如下代码:
Class Base{}
Public class MyCast extends Base{
Static boolean b1=false;
Static int i = -1;
Static double d = 10.1;
Public static void main(String argv[]){
MyCast m = new MyCast();
Base b = new Base();
//Here
}
}
则在 //Here 处插入哪个代码将不出现编译和运行错误。
A. b=m;
B. m=b;
C. d =i;
D. b1 =i;
[多选题]考虑如下代码:
Class Tree{}
Class Pine extends Tree{}
Class Oak extends Tree{}
Public class Forest {
Public static void main( String[] args ) {
Tree tree = new Pine();
If( tree instanceof Pine )
System.out.println( "Pine" );
If( tree instanceof Tree )
System.out.println( "Tree" );
If( tree instanceof Oak )
System.out.println( "Oak" );
Else
System.out.println( "Oops" );
}
}
则输出结果中有哪些?
A. Pine
B.Tree
C.Forest
D.Oops E .无输出