what is meant by direct initialisation of an array in java
Answers
Answered by
6
The initializer for an array is a comma-separated list of constant expressions enclosed in braces ( { } ). If an array is partially initialized, elements that are not initialized receive the value 0 of the appropriate type. ... The same applies to elements of arrays with static storage duration
Answered by
3
When we directly provide the elements of an array during its initialization/declaration is called direct initialization of an Array in Java.
For Example -
int[ ] numbers = {1, 2, 3, 4, 5};
Similar questions