Prototype: parsePort(String value) -> int accepts only one or more ASCII decimal digits, no signs/whitespace, and requires 1..65535. Invalid input raises IllegalArgumentException.

Final: parseOptions(String[] args) -> Options(int port,boolean verbose). Defaults: port 8080, verbose false. Accept --port followed by a parsePort value and/or --verbose in either order. Reject unknown flags, missing port values, repeated --port, repeated --verbose, and invalid ports. Return only after validating the full array, preserve args, and share no configuration state between calls.

Drag or use the arrow keys to resize. Home collapses the question; End collapses the editor. Enter or double-click resets the split.
Loading editor…
No results yet.

Complete the starter code, then run the checks.
Results and errors will appear here.

Java runs on this device with CheerpJ 4.3.