-->
当前位置:首页 > 题库

单选题:For the code below, which statement is right? ( )

Luz5年前 (2021-05-10)题库984
For the code below, which statement is right? ( ) @[C](2)
```Java
public class MyClass {
static int myArg = 1;
public static void main(String[] args) {
int myArg;
System.out.println(myArg);
}
}
```

A. Compiles, result is 1
B. Compiles, result is 0
C. Compile error for no initialization for myArg
D. Compile error for local variable myArg has the same name with a static one




A.Compiles, result is 1
B.Compiles, result is 0
C.Compile error for no initialization for myArg
D.Compile error for local variable myArg has the same name with a static one


答案:C