What will be the default values of all the elements of an array defined as an instance variable? Ans. If the array is an array of primitive types, then all the elements of the array will be initialized to the default value corresponding to that primitive type. Example: All the elements of an array of int will be initialized to 0(zero), while that of boolean type will be initialized to false. Whereas if the array is an array of references (of any type), all the elements will be initialized to null. - Study24x7
Social learning Network
18 Dec 2023 11:04 AM study24x7 study24x7

What will be the default values of all the elements of an array defined as an instance variable? Ans. If the array is an array of primitive types, then all the elements of the array will be initialized to the default value corresponding to that primitive type. Example: All the ...

See more

study24x7
Write a comment
Related Questions
500+   more Questions to answer
Most Related Articles