单项选择题
以下哪种初始化数组的方式是错误的?()
A. String[]names={"zhang", "wang", "li"); B. String names[] =new String [3];names [0] ="zhang"; names [1] ="wang"; names [2] ="li"; C. String[3] names={"zhang", "wang", "li"}; D. 以上皆正确
现有: class Output { public static void main (String[]...
现有: class Output { public static void main (String[] args) { int i=5: System.out.print( "4"+i+""); System.out.print (i+5+"7"); System.out.println (i+"8"); } } 结果为:()
A. 99722 B. 955758 C. 4510758 D. 459722
现有: public class Tester { public static void main (St...
现有: public class Tester { public static void main (String[] args) { intx-5; Integer xl=x; Integer x2=x; int x3=new Integer(5); system..ut.print(x1.equals(x)); system..ut.print(xl==x); system..ut.print(x2.equals(xl)); system..ut.print(x2==xl); system..ut.print(x2==x3); system..ut.print(x2.equals(x3)); } } 结果为:()
A.编译失败 B.falsefalsetruetruetruetrue C.truetruetruetruetruetrue D.falsefalsetruetruetruefalse E.truefalsetruefalsefalsetrue F.运行时异常被抛出
现有: class Ifs { public static void main (String [...
现有: class Ifs { public static void main (String [] args) { boolean state=false; int i=2; if( (++i>2) && (state=true)) i++; if( (++i>4) l l (state=false)) i++; System.out .println (i); } } 结果为:()
A. 6 B. 5 C. 4 D.编译失败