what does an array contain when it is declared?
For example, when i declare an int array numbers like:
int[] numbers=new int[5];
now without intializing any values, i tried to print that array.So it showed me that all elements inside that array were 0.
Now if 0 means empty, then if i assign some random values to that arrays, and then i assign
say for eg, number[3]=0.
does this mean that that element is empty or it means that it is simply assigned 0 value.
hszforu
-3
Junior Poster in Training
Recommended Answers
Jump to PostUninitialized arrays are bitwise zeroed..The values for a uninitialized int array are zero.
Jump to Postint array cannot be empty. Empty is for string. Int can have only numbers. So when you initialize a new integer array all indexes set to zero This is 0 and not empty.
Jump to Postpop operation? What is that?
All 10 Replies
gerard4143
371
Nearly a Posting Maven
hszforu
-3
Junior Poster in Training
Mitja Bonca
557
Nearly a Posting Maven
hszforu
-3
Junior Poster in Training
Mitja Bonca
557
Nearly a Posting Maven
hszforu
-3
Junior Poster in Training
Narue
5,707
Bad Cop
Team Colleague
hszforu
-3
Junior Poster in Training
Narue
5,707
Bad Cop
Team Colleague
hszforu
-3
Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.