单项选择题
下列程序test类中的变量e的最后结果为( )。
public class test
public static void main (String args[])
int a=10;
int b;
int c;
if(a>50)
b=9;
c=b+a;
A.10
B.0
C.19
D.编译出错
点击查看答案
<上一题
目录
下一题>
热门
试题
单项选择题
关于以下程序代码的说明正确的是( ) (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=103
D.程序通过编译,输出结果为:x=100
点击查看答案
单项选择题
已知如下代码: public class Test long a[]=new long[10] public static void main (String args[] System.out.println(a[6]; 以下( )语句是正确的。
A.Output is null.
B.When running,some error will occur.
C.When compile,some error will occur.
D.Output is 0.
点击查看答案
相关试题
00101010(1)00010111语...
已知i为整型变量,关于一元运算+ + i和...
以下不属于Java命名规范中包含的名称是( ...
下列语句序列执行后,j的值是( )。 int...
下列( )语句是声明一个含有10个String...