 Hello friends, I am Sanjay Gupta. I welcome you on my channel. You can watch various programming related videos on my channel. So you can search it, you can subscribe it. My channel contains 800 plus videos and you can also search those videos using this keyword programming by Sanjay Gupta. In this video, I am going to demonstrate you the attribute array.length which is available in Java. So in Java, whenever we use array, a predefined attribute that is known as length is available. So in this video, you will learn how you can use it. So name of class will be array length. Inside this class, I am going to define main method. Inside this main method, I am going to declare an array. Now I am going to allocate memory for this array. So in case of Java, arrays are dynamic. I am going to use new operator to allocate memory blocks for array. Now I am going to display elements of array without reading elements from user. So another property of array in Java is that it is initialized automatically with a particular value. So I have declared array of integer type. So this array will be containing 0 as default value. So for condition, here I am going to use length. So you can see at line number 8, for condition checking I am using length attribute which is available in array. So you don't have to put size of the array here. It is automatically calculated with the help of this length attribute. So this attribute was not available with C and C++ languages. But it is available in Java. So you can use it. Now, with the help of system.out.println, I am going to display elements of array on output screen. So this way I have implemented this code in front of you. Now I am going to compile and execute it. So the code is saved in D drive in Java folder. So I have changed the location. So I have compiled the code. It is compiled successfully. It is not showing any error. Then I am executing the code. You can see it is showing 5 zeros. So in our case, size of array is 5. So 5 zeros are initialized automatically and with the help of this for loop all the elements in form of 0 are displayed on output screen. So I hope you have understood how you can use the default attribute of array that is length for condition checking or whenever you want to use the size of array, you can simply put an array name dot length because you don't need to remember what is the size of array and if you have multiple arrays like in your program you have 10 to 20 arrays then you can't remember size of each array. So you just put name of array then dot and then length of that array. So this is the advantage of using this attribute which is available in Java. I hope you have understood whatever I have demonstrated you in this video. If you want to watch more programming related videos, you can search keyword programming by Sanjay Gupta on YouTube. Thank you for watching this video.