多选题
Given the SampleClass, what is the value of currentCount for the
instance of object x after the code segment had be executed?
SampleClass x = new SampleClass();
SampleClass y = new
SampleClass();
x.increaseCount();
public class
SampleClass {
private static int currentCount=();
public SampleClass() {
currentCount++;
}
public void increaseCount() {
currentCount++;
}
}
- A. 0
- B. 1
- C. 2
- D. 3
- E. Compiler error
- F. Runtime error