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

题目内容 (请给出正确答案)
关于以下application的说明,正确的是() 1.classStaticStuff 2.{ 3.staticintx=10; 4.static{x =5;} 5.publicstaticvoidmain(Stringargs[]) 6.{ 7.System.out.println(“x=” x); 8.} 9.static{x/=3;} 10.}

A.4行与9行不能通过编译,因为缺少方法名和返回类型

B.9行不能通过编译,因为只能有一个静态初始化器

C.编译通过,执行结果为:x=5

D.编译通过,执行结果为:x=3


参考答案

更多 “ 关于以下application的说明,正确的是() 1.classStaticStuff 2.{ 3.staticintx=10; 4.static{x =5;} 5.publicstaticvoidmain(Stringargs[]) 6.{ 7.System.out.println(“x=” x); 8.} 9.static{x/=3;} 10.} A.4行与9行不能通过编译,因为缺少方法名和返回类型B.9行不能通过编译,因为只能有一个静态初始化器C.编译通过,执行结果为:x=5D.编译通过,执行结果为:x=3 ” 相关考题
考题 关于以下程序代码的说明正确的是() 1.classHasStatic{ 2.privatestaticintx=100; 3.publicstaticvoidmain(Stringargs[]){ 4.HasStatichs1=newHasStatic(); 5.hs1.x ; 6.HasStatichs2=newHasStatic(); 7.hs2.x ; 8.hs1=newHasStatic(); 9.hs1.x ; 10.HasStatic.x--; 11.System.out.println(“x=” x); 12.} 13.}A.5行不能通过编译,因为引用了私有静态变量B.10行不能通过编译,因为x是私有静态变量C.程序通过编译,输出结果为:x=103D.程序通过编译,输出结果为:x=102

考题 关于以下application的说明,正确的是( )。 (1)class StaticStuff (2){ (3)static int x=15; (4)static {x*=3;) (5)public static void main (StringArgs[]) (6){ (7)System.out.println("x="+x); (8)} (9)static{x/=3;} (10) }A.(4)行与(9)行不能通过编译,因为缺少方法名和返回类型B.(9)行不能通过编译,因为只能有一个静态初始化器C.编译通过,执行结果为:x=15D.编译通过,执行结果为:x=3

考题 关于以下程序代码的说明正确的是( ) (1) class HasStatic{ (2) private static int x=100: (3) public static void main (String args[]{ (4) HasStatic hs1=new Has Static(); (5) hs1.x + +; (6) Has Static hs2=new HasStatic(); (7) hs2.x + +; (8) hs1=new HasStatic(); (9) hs1.x + +: (10) System.out.println("x="+ x); (11) } (12) }A.(5)行不能通过编译,因为引用了私有静态变量B.(10)行不能通过编译,因为x是私有静态变量C.程序通过编译,输出结果为:x=103D.程序通过编译,输出结果为:x=100

考题 关于以下程序代码的说明正确的是 ( )(1)class HasStatic{(2)private static int x=100;(3)public static void main(String args[]){(4)HasStatic hs1=new HasStatic();(5)hs1.x++;(6)HasStatic hs2=new HasStatic();(7)hs2.x++;(8)hs1=new HasStatic();(9)hs1.x++;(10)System.out.println("x="+x);(11)}(12)}A.(5)行不能通过编译,因为引用了私有静态变量B.(10)行不能通过编译,因为x是私有静态变量C.程序通过编译,输出结果为:x=103D.程序通过编译,输出结果为:x=100

考题 已知集合P={x|0 ≤x ≤5,x∈Z},Q={y|y=|x2-1|,x∈P},则P∩Q中元素的个数是( ).(A)3.(B)6.(C)8.(D)9.

考题 方程log13|x|=sin(π/2-1/2x)的实根的个数是( ).(A)2.(B)4.(C)6.(D)8.

考题 8.设A={x|x2+4x+3=0},B={x|x2-2x-15=0},则A∩B= ()A.{-1,-3,5}B.{5,-3}C.{-3}D.Φ

考题 6.【题干】下列计算正确的是() 【选项】A. 3x•2x=5x B. 3x•2x=5x2 C. 3x•2x=6x D. 3x•2x=6x2

考题 以下程序的说明,正确的是 public class StaticStuff { static int x=10; static { x+=5;} public static void main(String args[ ]) { System.out.println(“x=” + x); } static { x/=3;} }A.4行与9行不能通过编译,因为缺少方法名和返回类型B.9行不能通过编译,因为只能有一个静态初始化器C.编译通过,执行结果为:x=5D.编译通过,执行结果为:x=3