当前位置:高考升学网 > 招聘笔试题 > 正文

新华信国际信息咨询JAVA工程师笔试题和面试题答案(四)

更新:2023-09-18 13:10:37 高考升学网

  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;

  11.i = objY.superclassVarX;

  12.}

  13.}

  Choices:

  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.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;

  11.i = objY.superclassVarX;

  12.}

  13.}

  Choices:

  A.Compilation error at line 5

  B.Compilation error at line 9

  C.Runtime exception at line 11

  D.None of these

  12:Which statement about listener is true?

  A.Most component allow multiple listeners to be added.

  B.If multiple listener be add to a single component, the event only affected one listener.

最新图文

2020年河北新闻网两学一做

时间:2023-09-18 07:0:24

2020年河北新闻网两学一做

时间:2023-09-15 11:0:59

两学一做学习教育知

时间:2023-09-21 06:0:30

2020年开展两学一做学习教

时间:2023-09-19 21:0:30