niusouti.com

单选题public class Bootchy {  int bootch;  String snootch;  public Bootchy() {  this(”snootchy”);  System.out.print(”first “);  }  public Bootchy(String snootch) {  this(420, “snootchy”);  System.out.print(”second “);  }  public Bootchy(int bootch, String sn

题目
单选题
public class Bootchy {  int bootch;  String snootch;  public Bootchy() {  this(”snootchy”);  System.out.print(”first “);  }  public Bootchy(String snootch) {  this(420, “snootchy”);  System.out.print(”second “);  }  public Bootchy(int bootch, String snootch) {  this.bootch = bootch;  this.snootch = snootch;  System.out.print(”third “);  }  public static void main(String[] args) {  Bootchy b = new Bootchy();  System.out.print(b.snootch +“ “ + b.bootch);  }  }  What is the result?()
A

 snootchy 420 third second first

B

 snootchy 420 first second third

C

 first second third snootchy 420

D

 third second first siiootchy 420

E

 third first second snootchy 420

F

 first second first third snootchy 420


相似考题
参考答案和解析
正确答案: C
解析: 暂无解析
更多“单选题public class Bootchy {  int bootch;  String snootch;  public Bootchy() {  this(”snootchy”);  System.out.print(”first “);  }  public Bootchy(String snootch) {  this(420, “snootchy”);  System.out.print(”second “);  }  public Bootchy(int bootch, String sn”相关问题
  • 第1题:

    以下程序调试结果为: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


    正确答案:C

  • 第2题:

    public class Pet{     private String name;     public Pet(String name){       this.name = name;    }  public void speak(){     System.out.print(name); }  }  public class Dog extends Pet{     public Dog(String name){       super(name);    }  public void speak(){    super.speak();  System.out.print(“ Dog ”);    } }  执行代码   Pet pet = new Dog(“京巴”);  pet.speak();  后输出的内容是哪项?() 

    • A、 京巴
    • B、 京巴 Dog
    • C、 null
    • D、 Dog京巴

    正确答案:B

  • 第3题:

    public class Pet{     private String name;     public Pet(){  System.out.print(1);    }  public Pet(String name){        System.out.print(2);    } }  public class Dog extends Pet{     public Dog(){  System.out.print(4);    }  public Dog(String name){        super(name);  System.out.print(3);    } }  执行new Dog(“棕熊”);后程序输出是哪项?()  

    • A、 33
    • B、 13
    • C、 23
    • D、 123

    正确答案:C

  • 第4题:

    public class Pet{   private String name;   public Pet(){   System.out.print(1);  }   public Pet(String name){   System.out.print(2);  }   }   public class Dog extends Pet{  public Dog(String name){   //这里隐藏了一句代码:super.pet();   System.out.print(3);  }   }   执行new Dog(“棕熊”);后程序输出是哪项?() 

    • A、 23
    • B、 1 3
    • C、 123
    • D、 321

    正确答案:B

  • 第5题:

    public class Pet{   private String name;   public Pet(){   System.out.print(1);  }   public Pet(String name){   System.out.print(2);   }  }   public class Dog extends Pet{  public Dog(){   System.out.print(4);  }   public Dog(String name){   //这里隐藏了一句代码:super.pet();   this();   System.out.print(3);  }  }   执行new Dog(“棕熊”);后程序输出是哪项?() 

    • A、 143
    • B、 423
    • C、 243
    • D、 1134

    正确答案:A

  • 第6题:

    class Beverage {   Beverage() { System.out.print("beverage "); }   }   class Beer extends Beverage {   public static void main(String [] args) {   Beer b = new Beer(14);   }   public int Beer(int x) {   this();   System.out.print("beer1 ");   }   public Beer() { System.out.print("beer2 "); }  }   结果是什么?()  

    • A、beer1 beverage
    • B、beer2 beverage
    • C、beverage beer1
    • D、编译失败

    正确答案:D

  • 第7题:

    public class TestApp{  public static void main(String[] args){       try{  int i = 0;           int j = 1 / i;           String myname=null;            if(myname.length()>2)              System.out.print(“1”);        }catch(NullPointerException e){  System.out.print(“2”);       }  catch(Exception e){  System.out.print(“3”);       }   } }  上述程序运行后的输出是哪项?()

    • A、 3
    • B、 2
    • C、 231
    • D、 32

    正确答案:A

  • 第8题:

    单选题
    public class Pet{     private String name;     public Pet(){  System.out.print(1);    }  public Pet(String name){        System.out.print(2);    } }  public class Dog extends Pet{     public Dog(String name){        System.out.print(3);    } }  执行new Dog(“棕熊”);后程序输出是哪项?()
    A

     23

    B

     13

    C

     123

    D

     321


    正确答案: C
    解析: 暂无解析

  • 第9题:

    单选题
    现有  class Beverage {  Beverage ()  {  System.out.print ("beverage ");  }        }  class Beer extends Beverage {  public static void main{string [] args) {        Beer b = new Beer (14) ;       }  public int Beer(int x) {       this () ;  System.out.print ("beerl") ;      }  public Beer() { System.out.print("beer2 "); }     }  结果是什么?()
    A

    beerl beverage

    B

    beer2 beverage

    C

    beverage beer2 beerl

    D

    编译失败


    正确答案: C
    解析: 暂无解析

  • 第10题:

    单选题
    class ClassA {  public int numberOfinstances;  protected ClassA(int numberOfinstances) {  this.numberOflnstances = numberOfinstances;  }  }  public class ExtendedA extends ClassA {  private ExtendedA(int numberOfinstances) {  super(numberOflnstances);  }  public static void main(String[] args) {  ExtendedA ext = new ExtendedA(420);  System.out.print(ext.numberOflnstances);  }  }  Which is true?()
    A

     420 is the output.

    B

     An exception is thrown at runtime.

    C

     All constructors must be declared public.

    D

     Constructors CANNOT use the private modifier.

    E

     Constructors CANNOT use the protected modifier.


    正确答案: E
    解析: 暂无解析

  • 第11题:

    单选题
    public class TestApp{  public static void main(String[] args){       try{  int i = 0;           int j = 1 / i;           String myname=null;            if(myname.length()>2)              System.out.print(“1”);        }catch(NullPointerException e){  System.out.print(“2”);       }  catch(Exception e){  System.out.print(“3”);       }   } }  上述程序运行后的输出是哪项?()
    A

     3

    B

     2

    C

     231

    D

     32


    正确答案: A
    解析: 暂无解析

  • 第12题:

    单选题
    class Beverage {   Beverage() { System.out.print("beverage "); }   }   class Beer extends Beverage {   public static void main(String [] args) {   Beer b = new Beer(14);   }   public int Beer(int x) {   this();   System.out.print("beer1 ");   }   public Beer() { System.out.print("beer2 "); }  }   结果是什么?()
    A

    beer1 beverage

    B

    beer2 beverage

    C

    beverage beer1

    D

    编译失败


    正确答案: C
    解析: 暂无解析

  • 第13题:

    public class Pet{     private String name;     public Pet(){  System.out.print(1);    }  public Pet(String name){        System.out.print(2);    } }  public class Dog extends Pet{     public Dog(String name){        System.out.print(3);    } }  执行new Dog(“棕熊”);后程序输出是哪项?() 

    • A、 23
    • B、 13
    • C、 123
    • D、 321

    正确答案:B

  • 第14题:

    public class Base {  public static final String FOO = “foo”;  public static void main(String[] args) {  Base b = new Base();  Sub s = new Sub();  System.out.print(Base.FOO);  System.out.print(Sub.FOO);  System.out.print(b.FOO);  System.out.print(s.FOO);  System.out.print(((Base)s).FOO);  } }  class Sub extends Base {public static final String FOO=bar;}  What is the result?() 

    • A、 foofoofoofoofoo
    • B、 foobarfoobarbar
    • C、 foobarfoofoofoo
    • D、 foobarfoobarfoo
    • E、 barbarbarbarbar
    • F、 foofoofoobarbar
    • G、 foofoofoobarfoo

    正确答案:D

  • 第15题:

    public class Bootchy {  int bootch;  String snootch;  public Bootchy() {  this(”snootchy”);  System.out.print(”first “);  }  public Bootchy(String snootch) {  this(420, “snootchy”);  System.out.print(”second “);  }  public Bootchy(int bootch, String snootch) {  this.bootch = bootch;  this.snootch = snootch;  System.out.print(”third “);  }  public static void main(String[] args) {  Bootchy b = new Bootchy();  System.out.print(b.snootch +“ “ + b.bootch);  }  }  What is the result?() 

    • A、 snootchy 420 third second first
    • B、 snootchy 420 first second third
    • C、 first second third snootchy 420
    • D、 third second first siiootchy 420
    • E、 third first second snootchy 420
    • F、 first second first third snootchy 420

    正确答案:D

  • 第16题:

    Public class Holt extends Thread{   Private String sThreadName;   Public static void main(String argv[]) {  Holt  h=new Holt(); h.go(); Holt(){};  Holt(String s){ sThreadName=s;  Public String getThreadName() {  return sThreadName;} }  Public void go(){  Hot first=new Hot("first"); first.start();  Hot second=new Hot("second"); second.start();  }  Public void start() {  For(int i=0;i<2;i++) {  System.out.print(getThreadName()+i); Try{  Thread.sleep(100); }catch(Exception e){  System.out.print(e.getMessage()) ;  } } }  }  当编译运行上面代码时,将会出现() 

    • A、编译时错误
    • B、输出first0,second0,first0,second1
    • C、输出first0,first1,second10,second1
    • D、运行时错误

    正确答案:C

  • 第17题:

    class ClassA {  public int numberOfinstances;  protected ClassA(int numberOfinstances) {  this.numberOflnstances = numberOfinstances;  }  }  public class ExtendedA extends ClassA {  private ExtendedA(int numberOfinstances) {  super(numberOflnstances);  }  public static void main(String[] args) {  ExtendedA ext = new ExtendedA(420);  System.out.print(ext.numberOflnstances);  }  }  Which is true?() 

    • A、 420 is the output.
    • B、 An exception is thrown at runtime.
    • C、 All constructors must be declared public.
    • D、 Constructors CANNOT use the private modifier.
    • E、 Constructors CANNOT use the protected modifier.

    正确答案:A

  • 第18题:

    public class Pet{     private String name;     public Pet(){  System.out.print(1);    }  public Pet(String name){        System.out.print(2);    } }  public class Dog extends Pet{     public Dog(){  System.out.print(4);    }  public Dog(String name){        this();  System.out.print(3);    } }  执行new Dog(“棕熊”);后程序输出是哪项?()  

    • A、 143
    • B、 423
    • C、 243
    • D、 1134

    正确答案:A

  • 第19题:

    单选题
    public class Pet{   private String name;   public Pet(){   System.out.print(1);  }   public Pet(String name){   System.out.print(2);  }  }   public class Dog extends Pet{  public Dog(){   System.out.print(4);  }   public Dog(String name){   super(name);   System.out.print(3);  }   }   执行new Dog(“棕熊”);后程序输出是哪项?()
    A

     33

    B

     13

    C

     23

    D

     123


    正确答案: D
    解析: 暂无解析

  • 第20题:

    单选题
    Public class Holt extends Thread{   Private String sThreadName;   Public static void main(String argv[]) {  Holt  h=new Holt(); h.go(); Holt(){};  Holt(String s){ sThreadName=s;  Public String getThreadName() {  return sThreadName;} }  Public void go(){  Hot first=new Hot("first"); first.start();  Hot second=new Hot("second"); second.start();  }  Public void start() {  For(int i=0;i<2;i++) {  System.out.print(getThreadName()+i); Try{  Thread.sleep(100); }catch(Exception e){  System.out.print(e.getMessage()) ;  } } }  }  当编译运行上面代码时,将会出现()
    A

    编译时错误

    B

    输出first0,second0,first0,second1

    C

    输出first0,first1,second10,second1

    D

    运行时错误


    正确答案: B
    解析: 暂无解析

  • 第21题:

    单选题
    public class Pet{   private String name;   public Pet(){   System.out.print(1);  }   public Pet(String name){   System.out.print(2);   }  }   public class Dog extends Pet{  public Dog(){   System.out.print(4);  }   public Dog(String name){   //这里隐藏了一句代码:super.pet();   this();   System.out.print(3);  }  }   执行new Dog(“棕熊”);后程序输出是哪项?()
    A

     143

    B

     423

    C

     243

    D

     1134


    正确答案: D
    解析: 暂无解析

  • 第22题:

    单选题
    public class Bootchy {  int bootch;  String snootch;  public Bootchy() {  this(”snootchy”);  System.out.print(”first “);  }  public Bootchy(String snootch) {  this(420, “snootchy”);  System.out.print(”second “);  }  public Bootchy(int bootch, String snootch) {  this.bootch = bootch;  this.snootch = snootch;  System.out.print(”third “);  }  public static void main(String[] args) {  Bootchy b = new Bootchy();  System.out.print(b.snootch +“ “ + b.bootch);  }  }  What is the result?()
    A

     snootchy 420 third second first

    B

     snootchy 420 first second third

    C

     first second third snootchy 420

    D

     third second first siiootchy 420

    E

     third first second snootchy 420

    F

     first second first third snootchy 420


    正确答案: C
    解析: 暂无解析

  • 第23题:

    单选题
    public class Pet{   private String name;   public Pet(){   System.out.print(1);  }   public Pet(String name){   System.out.print(2);  }   }   public class Dog extends Pet{  public Dog(String name){   //这里隐藏了一句代码:super.pet();   System.out.print(3);  }   }   执行new Dog(“棕熊”);后程序输出是哪项?()
    A

     23

    B

     1 3

    C

     123

    D

     321


    正确答案: A
    解析: 暂无解析

  • 第24题:

    单选题
    public class Base {  public static final String FOO = “foo”;  public static void main(String[] args) {  Base b = new Base();  Sub s = new Sub();  System.out.print(Base.FOO);  System.out.print(Sub.FOO);  System.out.print(b.FOO);  System.out.print(s.FOO);  System.out.print(((Base)s).FOO);  } }  class Sub extends Base {public static final String FOO=bar;}  What is the result?()
    A

     foofoofoofoofoo

    B

     foobarfoobarbar

    C

     foobarfoofoofoo

    D

     foobarfoobarfoo

    E

     barbarbarbarbar

    F

     foofoofoobarbar

    G

     foofoofoobarfoo


    正确答案: B
    解析: 暂无解析