单选题现有:      class Test2  f  public  static void main (String  []  args)  {      short a,b,C;      a=l;      b=2;  C=a+b;      a+=2:      }        以上代码中,哪一句是错误的?()Aa=1:BC=a+b;Ca+=2;Dshort a,b,C;

单选题
现有:      class Test2  f  public  static void main (String  []  args)  {      short a,b,C;      a=l;      b=2;  C=a+b;      a+=2:      }        以上代码中,哪一句是错误的?()
A

a=1:

B

C=a+b;

C

a+=2;

D

short a,b,C;


参考解析

解析: 暂无解析

相关考题:

下列代码中,将引起编译错误的行是1)public class Exercise{2)public static void main(String args[]){3)float f=0.0:4)f+=1.0;5) }6) }A.第2行B.第3行C.第4行D.第6行

执行下列程序段之后,输出的结果是( )。public class Test{ public static void main(String[ ] args) { byte a = 2; short b = 3; long c = 4; c=a%b*4%b; System.out.println(c) ; } }A.2B.1C.-1D.-2

( 8 )阅读下列代码public class Test2{public static void main(String args[]){System.out.println(5/2);}}其执行结果是 【 8 】 。

下列代码的执行结果是( )。 public class Test{ public static void main (String args[ ]){ System.out.println(5/2): } }A.2.50B.2C.2.5D.2.0

现有:classTest2fpublicstaticvoidmain(String[]args){shorta,b,C;a=l;b=2;C=a+b;a+=2:}以上代码中,哪一句是错误的?() A.a=1:B.C=a+b;C.a+=2;D.shorta,b,C;

下列代码的执行结果是( )。 class operator Test{ public static void main(String[]args){ int x=8; short y=2; system.out.println("xis"+ x + ",yis"+y); } }A.8和2B.8.0和2.0C.8和2.0D.8.0和2

下列代码的执行结果为( )。 public class Testl{ public static void main (String args[]){ int a=3,b=10: System.out.println((a+ +)*(-b)); }A.40B.36C.30D.27

下列代码的执行结果是 ( )public class Test2{public static void main(String args[]){int a=4,b=6,c=8;String s="abc";System.out.println(a+b+s+c);}}A.ababccB.464688C.46abc8D.10abc8

下列程序运行的结果是______。 public class ex22 { public static void main(String[] args) { int a=0,b=l; do{ if(b%2==0) a+=b; b++; }while(b<=100); System.out.println(a); } }A.5050B.2550C.2525D.2500

执行下列程序段之后,输出的结果是______。 public class Test8 { public StatiC void main (String[] args) { byte a=2; short b=3; long c=4; c=a%b*4%b; System.out.println (c); } }A.2B.1C.-2D.-1

下列程序的输出结果是______。 public class exl5 { public static void main(String[] args) { int a=2, b=8,c=12; a1: while( a<--c } { a2: do { a+=c; if (c==b++) { continue a1; } }while (true); } System.out.print (a); } }A.52B.46C.38D.0

下列代码的执行结果是( )。 public,class Test1 { public static void main(String args[]) { System.out.println(5/2); } }A.2.5B.2.0C.2.50D.2

执行下列程序段之后,输出的结果为______。 public class ex43 { public static void main(String[] args) { short a=127; short b=4; a>>>=--b; System.out.println(a); } }A.10B.15C.30D.128

下列程序输出结果为( )。 public class test { public static void main (String args[]) { int a=0; outer:for(int i=0;i<2;i + +) { for(int j=0;j<2;j+ +) { if(j>i) { continue outer; } a+ +; } } System.out.println(a); } }A.0B.2C.3D.4

下列程序的运行结果是( )。 public class Sun { public static void main(String args[]) { int a=1; int b=1; for(int i=1;i<=3;i++) { a=a+b; b=b+a; } System.out.println(a+" "+b); } }A.66B.5 8C.13 21D.34 55

Which declarations will allow a class to be started as a standalone program?()  A、public void main(String args[])B、public void static main(String args[])C、public static main(String[] argv)D、final public static void main(String [] array)E、public static void main(String args[])

现有:  class Test2  f  public static void main (String  []  args)  {      boolean X= true;      boolean y=false;      short Z=20;      if((x==true)  &  (y=true))  z++;     if((y==true) ||  (++z==22))  z++;      System. out .println( "z="+z);      }      结果是什么?()     A、Z=21B、Z=22C、Z=23D、Z= 24

现有:class Test2 fpublic static void main (String [] args) {short a,b,C;a=1;b=2;C=a+b;a+=2;}}以上代码中,哪一句是错误的?()A、a=1;B、C=a+b;C、a+=2;D、shorta,b,C;

现有:      class Test2  f  public  static void main (String  []  args)  {      short a,b,C;      a=l;      b=2;  C=a+b;      a+=2:      }        以上代码中,哪一句是错误的?()     A、a=1:B、C=a+b;C、a+=2;D、short a,b,C;

public class Yikes {  public static void go(Long n) {System.out.println(”Long “);}  public static void go(Short n) {System.out.println(”Short “);}  public static void go(int n) {System.out.println(”int “);}  public static void main(String [] args) {  short y= 6;  long z= 7;  go(y);  go(z);  }  }  What is the result?() A、 int LongB、 Short LongC、 Compilation fails.D、 An exception is thrown at runtime.

class A {  public byte getNumber() {  return 1;  }  }  class B extends A {  public short getNumber() {  return 2;  }  public static void main(String args[]) {  B b = new B();  System.out.println(b.getNumber()); }  }   What is the result?()A、 1B、 2C、 An exception is thrown at runtime.D、 Compilation fails because of an error in line 8.E、 Compilation fails because of an error in line 14.

public class Wow {  public static void go(short n) {System.out.println(”short”); }  public static void go(Short n) {System.out.println(”SHORT”);}  public static void go(Long n) {System.out.println(” LONG”); }  public static void main(String [] args) {  Short y= 6;  int z=7;  go(y);  go(z);  }  }  What is the result?() A、 short LONGB、 SHORT LONGC、 Compilation fails.D、 An exception is thrown at runtime.

单选题class A {  public byte getNumber() {  return 1;  }  }  class B extends A {  public short getNumber() {  return 2;  }  public static void main(String args[]) {  B b = new B();  System.out.println(b.getNumber()); }  }   What is the result?()A 1B 2C An exception is thrown at runtime.D Compilation fails because of an error in line 8.E Compilation fails because of an error in line 14.

单选题现有:class Test2 fpublic static void main (String [] args) {short a,b,C;a=1;b=2;C=a+b;a+=2;}}以上代码中,哪一句是错误的?()Aa=1;BC=a+b;Ca+=2;Dshorta,b,C;

单选题public class Wow {  public static void go(short n) {System.out.println(”short”); }  public static void go(Short n) {System.out.println(”SHORT”);}  public static void go(Long n) {System.out.println(” LONG”); }  public static void main(String [] args) {  Short y= 6;  int z=7;  go(y);  go(z);  }  }  What is the result?()A short LONGB SHORT LONGC Compilation fails.D An exception is thrown at runtime.

单选题public class Yikes {  public static void go(Long n) {System.out.println(”Long “);}  public static void go(Short n) {System.out.println(”Short “);}  public static void go(int n) {System.out.println(”int “);}  public static void main(String [] args) {  short y= 6;  long z= 7;  go(y);  go(z);  }  }  What is the result?()A int LongB Short LongC Compilation fails.D An exception is thrown at runtime.

单选题现有:  class Test2  f  public static void main (String  []  args)  {      boolean X= true;      boolean y=false;      short Z=20;      if((x==true)  &  (y=true))  z++;     if((y==true) ||  (++z==22))  z++;      System. out .println( "z="+z);      }      结果是什么?()AZ=21BZ=22CZ=23DZ= 24