Java FPT Software (Fsoft) Academy Practice Test

Access More Questions
Assume a Java program declares int size = 10; int[] arr = new int[size]; and prints each element in sequence with no separators. Without any assignment to arr, what is printed?
Correct Answer:
0000000000
Explanation:
Java initializes arrays of primitive types with default values, and for int that default is 0. Creating an array of length 10 gives you ten elements, all starting as 0. If you print each element in order with no separators, you get ten zeros in a row: 0000000000. The code compiles cleanly because array creation with a size is valid and no assignments change those values before printing. So the observed output is ten zeros concatenated together.

Access more questions from this quiz

Continue to Java FPT Software (Fsoft) Academy Practice Test for more practice questions and the full quiz experience.

Access More Questions