问题 单项选择题

下面程序段的输出结果为
package test;
public class Class A

int x=20;
static int y=6;
public static void main(String args[])

Class B b=new Class B();
b.go(10);
System.out.println("x"+b.x);


class ClassB

int x;
void go(int y)

ClassA a=new ClassA();
x=a.y;

A.x=10

B.x-20

C.x=6

D.编译不通过

答案

参考答案:C

解析: 本题考查在Java中静态变量(类变量)的用法。在题目程序段中生成了一个static int y=6类变量,在ClassA中调用的b.go<(10),只不过是在ClassB中的一个局部变量,通过调用ClassB中的go方法可以生成一个ClassA对象,并给这个新生成的对象赋以ClassA中的类变量y的值。从main()方法作为入口执行程序,首先生成一个ClassB的对象,然后b.go(10)会调用ClassA,会给x和y赋值,x=a.y后,x值为6,再返回去执行System.out.println("x="+b.x)语句,输出为x=6,可见,正确答案为逸项C。

完形填空
Just like a boxer, we , too come face to face with many opponents on the stage of life—problems and difficulties. The bad news is that we don’t really know when our           with these opponents occur. Here are several reasons why you should        yourself for success like a champion boxer!
You don’t practice on the stage, that’s where your skills and your abilities are      . This also means that you don’t       solving problems and developing yourself when       occur, you prepare yourself to face them long       you actually face them.
If you are talented, you probably need less       and training time in facing life’s challenges. Actually, for people who are born with    , training and learning becomes even more important.     the lazy person’s motto: “If it isn’t broken, why fix it?” Why wait for your roof to leak in the       season when you can fix it right away. Act
     .
Training enables you to gain intuition(直觉 )and reaction. With        practice and training, you build up your body, your mind and your heart and gain the intuition and reaction of a (n)     .The same thing is true in life. Without training, you will     . Without training, you will not be able to       how your enemy will hit you.
Keep in mind that training is born out of discipline and      . Even if you meet with some setbacks in your training process,     you keep at it and are confident, you will soon see      in your life and when problems come, you will be like the champion         who stands tall and fights until the final round is over and you’re     as the champion!
小题1:
A.friendshipsB.championshipsC.programsD.matches
小题2:
A.trainB.offerC.show D.bring
小题3:
A.appreciatedB.sharedC.evaluatedD.promoted
小题4:
A.finishB.startC.enjoyD.practice
小题5:
A.chancesB.problemsC.occasionsD.dangers
小题6:
A.beforeB.afterC.asD.since
小题7:
A.considerationB.attentionC.preparationD.instruction
小题8:
A.diseaseB.ambitionC.talentD.belief
小题9:
A.UnderstandB.AbandonC.CondemnD.Remember
小题10:
A.cloudy B.windyC.sunnyD.rainy
小题11:
A.on timeB.at timesC.right awayD.at last
小题12:
A.constantB.real C.stableD.quick
小题13:
A.enemyB.championC.opponentD.coach
小题14:
A.mix upB.mess upC.stand outD.break out
小题15:
A.checkB.proveC.handleD.predict
小题16:
A.confidenceB.experienceC.performanceD.improvement
小题17:
A.beforeB.unlessC.untilD.if
小题18:
A.exchangesB.resultsC.setbacksD.disadvantages
小题19:
A.judgeB.swimmerC.boxerD.runner
小题20:
A.claimedB.calledC.announcedD.elected
单项选择题