Your question is Code Execution and Behavior. Take a moment with it on the right.
Talk me through your thinking if you like. When you're confident, submit your answer and I'll grade it like a real screen (7/10 or better passes).
BlackBerry's device-management backend team likes to open interviews with a short Java prediction exercise. Read the snippet exactly as written below.
public class DeviceCounter {
static int counter = init();
static int init() {
return counter + 5;
}
public static void main(String[] args) {
Integer a = 127;
Integer b = 127;
Integer c = 200;
Integer d = 200;
System.out.println(counter);
System.out.println(a == b);
System.out.println(c == d);
}
}
What gets printed, in order, when main runs, and why? Explain your reasoning for each line rather than just stating the final output.