Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
4 views
in Java by (13.1k points)

Can anyone help me how I can able to find the logical size of an array like:

int[] ar = new int[10];

ar[0] = 1;

ar[1] = 2;

ar[2] = 3;

ar[3] = 4;

1 Answer

0 votes
by (26.7k points)

Basically, it will allocated with size 10, and also all the unassigned indexes contains a value of 0 for the datatype int.

I hope this will help.

Want to become a Java expert? join Java Course now!!

Want to know more about Java? Watch this video on Java Training | Java Course for Beginners:

Related questions

0 votes
1 answer
asked Mar 7, 2021 in Java by dante07 (13.1k points)
0 votes
1 answer
asked Feb 8, 2021 in Java by dante07 (13.1k points)
0 votes
1 answer
0 votes
1 answer
asked Jul 10, 2019 in Java by Ritik (3.5k points)

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...