单项选择题

执行下列程序段之后,变量n的值为( )。 public class Test { public static void main(String[ ] args){ int y = 2; int z = 3; int n = 4; n=n+-y* z/n; System. out. println(n); } }

A.3
B.-1
C.-12
D.-3
<上一题 目录 下一题>
热门 试题

单项选择题
下列运算符中,( )是布尔逻辑运算符。
A.++
B.<<
C.‖
D.&
单项选择题
运行下面的程序时,会产生( )。 public class Test{ public static void main(String args[ ] ) { int x =0; int y = 2 x; int z[ ] = {1,2,4,6}; int p=z[4]; } }
A.ArrayIndexOutOfBoundsExcePtion异常
B.NumberFormatException异常
C.ArithmeticException异常
D.ArithmeticException异常和ArrayIndexOutOfBoundsExcePtion异常
相关试题
  • 下列程序执行的结果是( )。 public cl...
  • 下列程序的输出结果是( )。 public cl...
  • 在结构化方法中,用数据流程图(DFD) 作...
  • 下列选项中可以创建一个标识有“关闭”的按...
  • 关于被私有访问控制符private修饰的成员变...