CJCoding With Joseph
15free / daySign inCreate account

PrintQueue holds waiting job names in a java.util.Queue so the printer serves them in submission order. submit(String) and size() are written.

Requirements: 1. Complete serveAll() so it removes every waiting job and returns their names in arrival order, separated by a comma and a space. 2. Return an empty string when nothing is waiting. 3. The queue must be empty when serveAll() returns.

Do NOT write a main method.

Expected output

3
report.pdf, photo.png, notes.txt
0

= newline. The output ends with a newline, so print one after the last line.

Hints4 available
Topics
Data Structures & AlgorithmsQueues
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (sysout, psvm, fori)

Your output

Run your code to see the output here...

Test cases

Run your code to see test case results.