【单选题】【消耗次数:1】
下列虚基类的声明中,正确的是( )
class virtual B:public A
virtual class B:public A
class B:public A virtual
class B:virtual public A
参考答案:
复制
纠错
相关题目
【单选题】 编译下面源程序会得到哪些文件( )? class A1{ } class A2{ } public class B{ public static void main(String[] args) { } }
①  只有B.class 文件
②  只有 A1.class 和 A2.class 文件
③  编译不成功
④  A1.class、A2.class 和B.class 文件
【单选题】 下面代码运行后的输出结果为( ) 。 public class X6_1_5 { public static void main(String[] args) { AB aa = new AB(); AB bb; bb = aa; System.out.println(b@@equals(aa)); } } class AB{ int x = 100; }
①  true
②  false
③  编译错误
④  100
【判断题】 A: Im afraid of speaking in public. B: Take it easy.
①  正确
②  错误
【单选题】 下列程序执行的结果是( ) 。 public class X7_1_6 { public static void main(String[] args) { try{ return; } finally{ System.out.println(Finally); } } }
①  程序正常运行,但不输出任何结果
②  程序正常运行,并输出 Finally
③  编译通过,但运行时出现异常
④  因为没有 catch 子句,因此不能通过编译
【单选题】 若有说明class Y{//…;public:staticint n;};int Y::n;Y objY;,则对n的正确访问语句是()
①  n=1;
②  Y::n=1;
③  objY::n=1;
④  Y-n;
【单选题】 编译运行以下程序后,关于输出结果的说明正确的是 ( ) public class Conditional{ public static void main(String args[ ]){ int x=4; System.out.println(“value is “+ ((x>4) ? 9.9:9)); } }
①  输出结果为:value is 99.9
②  输出结果为:value is 9
③  输出结果为:value is 9.0
④  编译错误
【单选题】 当一个类的某个函数被说明为virtual时,该函数在该类的所有派生类中()
①  都是虚函数
②  只有被重新说明时才是虚函数
③  只有被重新说明为virtual时才是虚函数
④  都不是虚函数
【单选题】 以下程序的运行结果是:( ) public class Increment{ public static void main(String args[]){ int c; c = 2; System.out.println(@@; System.out.println(c++); System.out.println(@@; } }
①  2 2 2
②  2 3 3
③  2 2 3
④  3 4 4
【单选题】 阅读以下代码: import java.io.*; import java.util.*; public class foo{ public static void main (String[] args){ String s; System.out.println(s= + s); } } 输出结果应该是:( )
①  代码得到编译,并输出“s=”
②  代码得到编译,并输出“s=null”
③  由于String s没有初始化,代码不能编译通过
④  代码得到编译,但捕获到 NullPointException异常
【单选题】 16. By using virtual reality programmes, it is possible to ____ deep into outer space without ever leaving Earth.
①  explore
②  find
③  escape
④  stay
随机题目
【单选题】 Theteacher,aswellasallhisstudents,________bythedancer’sperformance.
①  wasimpressed
②  wereimpressed
③  impressed
④  .hadimpressed
【单选题】 Theywillgohomeforwintervacationassoonasthey________theirexams.
①  havefinished
②  willhavefinished
③  willfinish
④  finish
【单选题】 It was in the countryside ________ I spent my childhood.
①  where
②  place
③  when
④  that
【单选题】 When we arrived at the airport, we found our flight ________.
①  cancelled
②  had cancelled
③  had been cancelled
④  has been cancelled
【单选题】 A country ________ birth rate is higher than its death rate will have an increasing population.
①  who
②  which
③  whose
④  where
【单选题】 Younevertoldmeyouhaveseenthefilm,________?
①  hadyou
②  didn’tyou
③  didyou
④  weren’tyou
【单选题】 The school was named ________ the hero who gave his life for the cause of the liberation.
①  for
②  with
③  after
④  about
【单选题】 Youdon’thavetobeinsuchahurry,Iwouldratheryou________onbusinessfirst.
①  wouldgo
②  willgo
③  went
④  havegone
【单选题】 Do what you think is right, ________ they say.
①  whatever
②  however
③  whenever
④  whichever
【单选题】 It suddenly ________ him that he should solve the problem with a computer.
①  occurred to
②  struck at
③  hit on
④  dawned in