网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
单选题
执行下面程序,输出的结果是?() public class Test{  public static void main(String[] args){  int a = 5;  double b = 8;  a = a++ + b;   System.out.println(a);  }  }
A

 第4行编译报错

B

 第5行编译报错

C

 编译成功,输出13

D

 编译成功,输出14


参考答案

参考解析
解析: 暂无解析
更多 “单选题执行下面程序,输出的结果是?() public class Test{  public static void main(String[] args){  int a = 5;  double b = 8;  a = a++ + b;   System.out.println(a);  }  }A  第4行编译报错B  第5行编译报错C  编译成功,输出13D  编译成功,输出14” 相关考题
考题 执行下面程序,输出的结果是?()publicclassTest{publicstaticvoidmain(String[]args){inta=5;doubleb=8;a=a+++b;System.out.println(a);}} A.第4行编译报错B.第5行编译报错C.编译成功,输出13D.编译成功,输出14

考题 阅读下列代码Public class Person{Static int arr[ ] = new int (10);Public static void main (String args ) {System.out.println(arr[9]);}}该代码运行的结果是A )编译时将产生错误B )编译时正确,运行时将产生错误C )输出 0D )输出空

考题 下列程序的执行结果是 ( ) public class Test { public int aMethod() { satic int i=0; i++; System.out.println(i); } public static void.main(String args[]) { Test test=new Test(); test.aMethod(); }A.编译错误B.0C.1D.运行成功,但不输出

考题 下列代码的执行结果是public class Test{ public int aMethod(){ static int i=0; i++; System.out.println(i); } public static void main(String args[]){ Test test= new Test(); test. aMethod(); }}A.编译错误B.0C.1D.运行成功,但不输出

考题 阅读下面代码 public class Person { static int arr[]=new int[10]; public static void main(String args) { System.out.println(arr[9]); } } 该代码的运行结果是A.编译时将产生错误B.编译时正确,运行时将产生错误C.输出零D.输出空

考题 对于下面一段代码的描述中,正确的是______。 public class ex36 { public static void run main(String[] args) throws Excepion { method(); } static void method() throws Exception try { System.out.println("test"); } finally { System.out.println ("finally"); } } }A.代码编译成功,输出“test”和“fmally”B.代码编译成功,输出“test”C.代码实现选项A中的功能,之后Java停止程序运行,抛出异常,但是不进行处理D.代码不能编译

考题 下列代码的执行结果是( )。public class Test{public int aMethod( ){static int i=0;i++;System.out.println(i):}public static void main (String args[]){Trest test=new Test ( );test aMethod( ):}}A.编译错误B.0C.1D.运行成功,但不输出B.C.D.

考题 类A及其派生类B定义如下:class A{ public int getInfo(int a) { return a; }}public class B extends A{ public float getInfo(int b) { return b; } public static void main(String[]args) { A a=new A(); B b=new B(); System.out.println(a.getInfo(3)+","+b.getInfo(5)); }}关于上述程序代码的叙述中正确的是 ( )A.第10行不能通过编译B.程序通过编译,输出结果为:3,3C.程序通过编译,输出结果为3,5D.程序通过编译,输出结果为:5,5

考题 以下代码的输出结果?public class Test{public static void main(String argv[]){String x="hello";change(x);System.out.println(x);}static void change(String m){m=m+2;}} A. helloB. hello2C. 编译报错D. 运行报错,不能将串与整数相加

考题 以下程序调试结果为: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.5B.8C.7D.无任何输出E.编译错误

考题 以下的程序的执行结果为? () public class Demo{  public double getHeight(){  return 171.0;  }  public int getHeight (){  return 171;  }  public static void main(String[] args){  Demo demo = new Demo();  System.out.println(demo.getHeight());  }  } A、输出171.0B、输出171C、第2行和第5行编译报错D、第10行编译报错

考题 执行以下代码会输出什么结果?()   public class Test {    StringgetStr(String s){  return s + “hello”;  }  public static void main(String arg[]) {           Test t= new Test();  System.out.println(t.getStr(“LiLei/n”));     } } A、 编译报错B、 LiLei    helloC、 LiLeihelloD、 无任何输出

考题 执行以下代码,输出结果的结果是? () public class Test{  public String[] ss = new String[5];    public static void main(String[] args){      System.out.println(ss[1]);  } } A、 nullB、 -1C、 编译时出错D、 运行时报错

考题 执行下面程序,输出的结果是?() public class Test{  public static void main(String[] args){  int a = 5;  double b = 8;  a = a++ + b;   System.out.println(a);  }  } A、 第4行编译报错B、 第5行编译报错C、 编译成功,输出13D、 编译成功,输出14

考题 执行以下代码后,下面哪些描述是正确的() public  class  Student{  private String name = “Jema”;  public void setName(String name){  this.name = name;  }  public String getName(){  return this.name;  }  public static void main(String[] args){  Student s;  System.out.println(s.getName()); } }A、输出nullB、第10行编译报错C、第11行编译报错D、输出Jema

考题 给定如下Java程序片断:  class A{  public A (){   System.out.println("A");  } }  class B extends A{  public B(){  System.out.println("B"); }  public static void main(String[] args){    B b=new B();  } }  上述程序将()。 A、不能通过编译B、通过编译,输出为:A BC、通过编译,输出为:BD、通过编译,输出为:A

考题 下面程序的输出结果是() public class Test{  public static void main(String[] args){    String s = “abc dsf ghi”;  String[] arr = s.split(“/s”);   System.out.println(arr.length);  } }A、 编译报错B、 2C、 1D、 3

考题 编译如下的Java程序片段:  Class test{     Int count=9;     Public void a(){   Int count=10;   System.out,println(“count 1=” + count); }  Public void count(){   System.out.println(“count 2 =”+ count); }  Public static void main(String args[] ){   Test t=new Test();   t.a();   t.count(); } }  结果是()A、不能通过编译B、输出:count 1 =10  count 2=9C、输出:count 1=9 count 2=9

考题 编译如下Java程序片断:  class test{  int count = 9;  public void a(){    int count=10;  System.out.println("count 1 =" + count);  }  public void count(){  System.out.println("count 2 =" + count);  }  public static void main(String args[]){    test t=new test();    t.a();   t.count();   } }  结果将()。    A、不能通过编译B、输出: count 1 = 10 count 2 = 9C、输出:count 1 = 9 count 2 = 9

考题 单选题执行下面程序,输出的结果是?() public class Test{  public static void main(String[] args){  int a = 5;  double b = 8;  a = a++ + b;   System.out.println(a);  }  }A  第4行编译报错B  第5行编译报错C  编译成功,输出13D  编译成功,输出14

考题 单选题编译如下的Java程序片段:  Class test{     Int count=9;     Public void a(){   Int count=10;   System.out,println(“count 1=” + count); }  Public void count(){   System.out.println(“count 2 =”+ count); }  Public static void main(String args[] ){   Test t=new Test();   t.a();   t.count(); } }  结果是()A 不能通过编译B 输出:count 1 =10  count 2=9C 输出:count 1=9 count 2=9

考题 单选题执行以下代码后,下面哪些描述是正确的() public  class  Student{  private String name = “Jema”;  public void setName(String name){  this.name = name;  }  public String getName(){  return this.name;  }  public static void main(String[] args){  Student s;  System.out.println(s.getName()); } }A 输出nullB 第10行编译报错C 第11行编译报错D 输出Jema

考题 单选题编译如下Java程序片断:  class test{  int count = 9;  public void a(){    int count=10;  System.out.println("count 1 =" + count);  }  public void count(){  System.out.println("count 2 =" + count);  }  public static void main(String args[]){    test t=new test();    t.a();   t.count();   } }  结果将()。A 不能通过编译B 输出: count 1 = 10 count 2 = 9C 输出:count 1 = 9 count 2 = 9

考题 单选题以下的程序的执行结果为? () public class Demo{  public double getHeight(){  return 171.0;  }  public int getHeight (){  return 171;  }  public static void main(String[] args){  Demo demo = new Demo();  System.out.println(demo.getHeight());  }  }A 输出171.0B 输出171C 第2行和第5行编译报错D 第10行编译报错

考题 单选题执行以下代码会输出什么结果?()   public class Test {    StringgetStr(String s){  return s + “hello”;  }  public static void main(String arg[]) {           Test t= new Test();  System.out.println(t.getStr(“LiLei/n”));     } }A  编译报错B  LiLei    helloC  LiLeihelloD  无任何输出

考题 单选题下面程序的输出结果是() public class Test{  public static void main(String[] args){    String s = “abc dsf ghi”;  String[] arr = s.split(“/s”);   System.out.println(arr.length);  } }A  编译报错B  2C  1D  3

考题 单选题给定如下Java程序片断:  class A{  public A (){   System.out.println("A");  } }  class B extends A{  public B(){  System.out.println("B"); }  public static void main(String[] args){    B b=new B();  } }  上述程序将()。A 不能通过编译B 通过编译,输出为:A BC 通过编译,输出为:BD 通过编译,输出为:A

考题 单选题执行以下代码,输出结果的结果是? () public class Test{  public String[] ss = new String[5];    public static void main(String[] args){      System.out.println(ss[1]);  } }A  nullB  -1C  编译时出错D  运行时报错