Programming practice

Java arrays practice

Each question shows a short Java snippet that creates and uses an array, then asks you to trace what gets printed to the console. Choose "No loops" for direct index questions or "With loops" for for and for-each problems. Generate a fresh set any time.

Advertisement

Interactive question set

Read each snippet carefully. For single-value output, type the number or word on one line. For multi-line output (multiple println calls or a loop that prints each element), type each printed value on its own line in the textarea.

Advertisement