Serial Extraction
A utility parses a formatted product serial number string to isolate the core identifier.
What is printed when the following Java program is compiled and run?
public class QuestionTrace {
public static void main(String[] args) {
String s = "PROD-9921-X";
String sub = s.substring(5, 9);
System.out.println(sub);
}
}
A
9921-
B
PROD
C
-9921
D
9921
Question Leaderboard
Not enough data yet to show leaderboard.
