Developer community
0 votes
61 views
asked by Expert (11.4k points) 14 22 29 | 61 views

1 Answer

0 votes
After we allocate memory for a Java array, Java assigns each element in an array to its initial values
 
Initial value
 
The initial value is zero in the case of an array of numerical values, is false for boolean arrays, is '\u0000' for arrays storing type char, and is null for an array of objects of a class type.
 
The following table lists the default value for various array types.
Element Type Initial Value
byte                         0
int                           0
float                        0.0f
char                      '\u0000'
object reference  null
short                     0
long                       0L
double                  0.0d
boolean             false
 
 
answered by Sr Member (5k points) 7 9 12

Related questions

0 votes
1 answer
asked by sunny Expert (11.4k points) 14 22 29 | 13 views
0 votes
1 answer
asked by john Guru (27.1k points) 32 50 97 | 28 views
0 votes
1 answer
asked by sara Guru (24.6k points) 29 51 78 | 34 views
+1 vote
1 answer
asked by keem Expert (13.2k points) 27 40 59 | 34 views
0 votes
1 answer
asked by augustaina Sr Member (4.8k points) 10 23 31 | 185 views
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

Categories


C Books Guide and List
C++ Books Guide and List
Best Java Books

3.8k questions

4k answers

117 comments

10.7k users

3,751 questions
4,046 answers
117 comments
10,709 users