单项选择题

下列程序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.
相关试题
  • 下面是用 RandomAccessFile oureFile; ...
  • 创建一个名为MyPackage的包的语句是 __...
  • 数据型包括简单数据类型和复合数据类型。简...
  • 以下程序段的输出结果为 ______。 ...
  • Java中访问限定符有 ______ ,Prot...