Midterm Exam 2023
Midterm Exam 2023
2. If a program compiles fine, but it produces incorrect result, then the program
suffers __________.
A. a compile error B. a runtime error C. a logic error
4. What is i printed?
public class Test {
public static void main(String[] args) {
int j = 0;
int i = ++j + j * 5;
System.out.println("What is i? " + i);
}}
A. 0 B. 1 C. 5 D. 6
5. Suppose you define a Java class as follows, the source code should be stored in a file
named _________.
public class Test { }
k = i + j;
System.out.println("k is " + k);
System.out.println("j is " + j);
}
}
1/2
SQ0000000F101002:نموذج رقم
2018/01/14 )0/2( اإلصدار