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

单选题:Given code below:

Luz5年前 (2021-05-10)题库869
Given code below:
```Java
public class Main {
int a = 10;
int c = 30;
public Runnable getRunnable() {
int a = 20;
return new Thread() {
public void run() {
int b = a+c;
}
};
}
}
```
What will be the value of b after the assignment in the run() method? @[C](2)

A. 30
B. 40
C. 50
D. Compile error




A.30
B.40
C.50
D.Compile error


答案:C