{"id":113938,"date":"2020-01-08T10:40:33","date_gmt":"2020-01-08T10:40:33","guid":{"rendered":"https:\/\/www.softwaretestinghelp.com\/?page_id=113938"},"modified":"2025-04-01T08:28:39","modified_gmt":"2025-04-01T08:28:39","slug":"java-array-declare-create-initialize","status":"publish","type":"page","link":"https:\/\/www.softwaretestinghelp.com\/java\/java-array-declare-create-initialize\/","title":{"rendered":"Java Array &#8211; Declare, Create &#038; Initialize An Array In Java"},"content":{"rendered":"<p><strong>This In-depth Tutorial Explains Various Ways to Declare, Create and Initialize a New Array With Values in Java with the Help of Simple Code Examples:<\/strong><\/p>\n<p>In our previous tutorial, we discussed the basics of arrays in Java along with the different concepts associated with arrays which we will learn in detail in this tutorial series.<\/p>\n<p>The first and foremost step with arrays is to create them. You need to be aware of what type of elements and how many elements you are going to store in arrays. Once you declare an array, you might want to initialize them by providing some initial values and there are various methods to do this.<\/p>\n<p><em><strong> <\/strong><\/em><\/p>\n<p><a href=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2019\/12\/Java-Array-Creation-Initialization-1.png\"><img decoding=\"async\" class=\"alignnone wp-image-113969 size-full\" src=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2019\/12\/Java-Array-Creation-Initialization-1.png\" alt=\"Declare Create Java Array\" width=\"650\" height=\"366\" srcset=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2019\/12\/Java-Array-Creation-Initialization-1.png 650w, https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2019\/12\/Java-Array-Creation-Initialization-1-300x169.png 300w\" sizes=\"(max-width: 650px) 100vw, 650px\" \/><\/a><\/p>\n<p>Thus in this tutorial, we will focus on creating and initializing arrays before moving on to other concepts.<\/p>\n<h3>How To Declare An Array In Java?<\/h3>\n<p><strong>In Java, a one-dimensional array is declared in one of the following ways:<\/strong><\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\ndata_type&#x5B;] array_name; {or}\r\ndata_type array_name&#x5B;]; {or}\r\ndata_type &#x5B;]array_name;<\/pre>\n<p>Here the \u2018data_type\u2019 specifies the type of data the array will hold. The \u2018data_type\u2019 can be a primitive data type or any derived type.<\/p>\n<p><u><strong>For Example,<\/strong><\/u> an array <strong>myarray<\/strong> of type integer is declared as follows:<\/p>\n<p>int[] myarray;<br \/>\nOR<br \/>\nint []myarray;<br \/>\nOR<br \/>\nint myarray[];<\/p>\n<p>This means that the array myarray will hold the elements of data type int.<\/p>\n<p>Note that as the arrays in Java are dynamically allocated, we do not specify any dimension or size of the array with the declaration. The above declaration tells the compiler that there is an array variable \u2018myarray\u2019 of type int which will be storing the integer type values in it.<\/p>\n<p>The compiler does not know the size or actual values stored in an array. It will only know that after we initialize the array.<\/p>\n<h3>Instantiate And Initialize A Java Array<\/h3>\n<p>We have already declared an array in the previous section. But this is just a reference. In order to use the above-declared array variable, you need to instantiate it and then provide values for it. The array is instantiated using \u2018new\u2019.<\/p>\n<p><strong>The general syntax of instantiating is as follows:<\/strong><\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">array_name = new data_type &#x5B;size];<\/pre>\n<p>In the above statement, array_name is the name of the array being instantiated.<\/p>\n<pre>data_type=&gt; type of elements the array is going to store\r\n\r\nsize=&gt; the number of elements that will be stored in array<\/pre>\n<p>Hence when you use new with the array, you are actually allocating the array with the data type and the number of elements.<\/p>\n<p><strong>So the above-declared array myarray can be instantiated as follows:<\/strong><\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">myarray = new int&#x5B;10]<\/pre>\n<p><strong>Thus creating an array in Java involves two steps as shown below:<\/strong><\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\nint&#x5B;] myarray;\t\t\t\/\/declaration\r\nmyarray = new int&#x5B;10]; \t\/\/instantiation<\/pre>\n<p><strong>Once the array is created, you can initialize it with values as follows:<\/strong><\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\nmyarray&#x5B;0] =  1;\r\nmyarray&#x5B;1] = 3; \u2026.and so on until all elements are initialized.\r\n<\/pre>\n<p>The expression in the square brackets above is called the index of the array. The index of the array is used to access the actual value of the elements i.e. the above array myarray of 10 int elements will have indices numbered from 0 to 9. You can access the element of the array at a particular position by specifying the index as above.<\/p>\n<p>Note that the array index always starts from 0. Alternatively, you can also do the initialization using a loop which we will see later on.<\/p>\n<p><strong>You can also use array literal and initialize array during declaration itself as shown below:<\/strong><\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">int&#x5B;] myarray = {1,3,5,7};<\/pre>\n<p>In the above statement, the length of the array is determined by the number of elements. Also, as you can see there is no need to use \u2018new\u2019. More importantly, the declaration, instantiation and the initialization of the array is done in a single statement.<\/p>\n<p><strong>Given below is a simple programming example of declaring and initializing the array.<\/strong><\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npublic class Main\r\n{\r\npublic static void main(String&#x5B;] args)\r\n        {\r\n\t    int&#x5B;] myarray;\t\t\t\/\/declaration\r\n\t    myarray = new int&#x5B;5];\t\/\/instantiation\r\n\t    myarray&#x5B;0] = 10;\t\t\/\/initialization\r\n\t    System.out.println(&quot;myarray&#x5B;0] = &quot; + myarray&#x5B;0]);  \/\/accessing and printing array elements\r\n\t    System.out.println(&quot;myarray&#x5B;1] = &quot; + myarray&#x5B;1]);\r\n\t    int &#x5B;] oddArray = {1,3,5,7};\t\/\/initialization with array literal\r\n            System.out.println(&quot;oddArray&#x5B;0] = &quot; + oddArray&#x5B;0]);\r\n\t    System.out.println(&quot;oddArray&#x5B;1] = &quot; + oddArray&#x5B;1]);\r\n\t    System.out.println(&quot;oddArray&#x5B;2] = &quot; + oddArray&#x5B;2]);\r\n\t    System.out.println(&quot;oddArray&#x5B;3] = &quot; + oddArray&#x5B;3]);\r\n        }\r\n}\r\n<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2019\/12\/Declaring-and-initializing-the-array_output.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-113964\" src=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2019\/12\/Declaring-and-initializing-the-array_output.png\" alt=\"Declaring and initializing the array_output\" width=\"201\" height=\"228\" \/><\/a><\/p>\n<p>This program demonstrated an array declaration and its instantiation as well as initialization. Note that as we have only initialized the o<sup>th<\/sup> value of myarray, the other value myarray[1] that is printed has a default value i.e. 0.<\/p>\n<p>The second array demonstrates the array literal variable. Even if you do not initialize the array, the Java compiler will not give any error. Normally, when the array is not initialized, the compiler assigns default values to each element of the array according to the data type of the element.<\/p>\n<p><strong>We will demonstrate these default values using the following program.<\/strong><\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\nclass Main \r\n{ \r\n  public static void main(String&#x5B;] args)     { \r\n   System.out.println(&quot;=======Default Values======&quot;);\r\n   System.out.print(&quot;String Array:&quot;); \r\n   String&#x5B;] array_str = new String&#x5B;5]; \t\t\/\/declaration and instantiation\r\n   for (String str : array_str) \t\t\t\/\/assumes default values\r\n         System.out.print(str + &quot; &quot;);             \r\n   System.out.println(&quot;\\n&quot;);\r\n\r\n   System.out.print(&quot;Integer array:&quot;); \r\n   \/\/array only instantiated not initialized\r\n   int&#x5B;] array_num = new int&#x5B;5]; \r\n   for (intnum : array_num) \r\n          System.out.print(num + &quot; &quot;);   \r\n   System.out.println(&quot;\\n&quot;);\r\n\r\n   System.out.print(&quot;Double array:&quot;); \r\n   \/\/array only instantiated not initialized\r\n   doublearray_double&#x5B;] = new double&#x5B;5]; \r\n   for (double dnum : array_double) \r\n       System.out.print(dnum + &quot; &quot;);   \r\n\r\n   System.out.println(&quot;\\n&quot;);\r\n   System.out.print(&quot;Boolean array:&quot;); \r\n   \/\/array only instantiated not initialized\r\n   booleanarray_bool&#x5B;] = new boolean&#x5B;5]; \r\n   for (booleanbval : array_bool) \r\n         System.out.print(bval + &quot; &quot;); \r\n   System.out.println(&quot;\\n&quot;);\r\n    } \r\n}\r\n<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2019\/12\/default-values_output.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-113965\" src=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2019\/12\/default-values_output.png\" alt=\"default values_output\" width=\"452\" height=\"174\" srcset=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2019\/12\/default-values_output.png 452w, https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2019\/12\/default-values_output-300x115.png 300w\" sizes=\"(max-width: 452px) 100vw, 452px\" \/><\/a><\/p>\n<p>In the above program, we have just declared and instantiated them. We have not initialized them to any values. Thus, when we display the contents of these arrays, depending on the data type of the array, the elements will have different default values.<\/p>\n<p>As seen above, string array has default as \u2018null\u2019, integer values are 0 and double values default to 0.0. Boolean values have their default values set to false.<\/p>\n<h3>Initializing And Accessing Array Elements<\/h3>\n<h4>#1) Using For Loop<\/h4>\n<p>The program written above uses an array literal for initializing and the other array elements are initialized separately. You can also use for loop to initialize the array elements.<\/p>\n<p><strong>We have converted the above array using array literal to initialize it using for loop in the below program.<\/strong><\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npublic class Main\r\n{\r\n    public static void main(String&#x5B;] args)\r\n    {\r\n\tint&#x5B;] oddArray;\t\t\t\/\/declaration\r\n\toddArray = new int&#x5B;5];\t\t\/\/instantiation\r\n\tfor(int i=0;i&lt;5;i++){\t\t\r\n\t     oddArray&#x5B;i] = i+1;\t\t\/\/initialization using for loop\r\n\t}\r\n\tSystem.out.println(&quot;oddArray&#x5B;0] = &quot; + oddArray&#x5B;0]);\r\n\tSystem.out.println(&quot;oddArray&#x5B;1] = &quot; + oddArray&#x5B;1]);\r\n\tSystem.out.println(&quot;oddArray&#x5B;2] = &quot; + oddArray&#x5B;2]);\r\n\tSystem.out.println(&quot;oddArray&#x5B;3] = &quot; + oddArray&#x5B;3]);\r\n\tSystem.out.println(&quot;oddArray&#x5B;4] = &quot; + oddArray&#x5B;4]);\r\n     }\r\n}\r\n<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2019\/12\/Array-literal-to-initialize-it-using-for_loop.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-113966\" src=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2019\/12\/Array-literal-to-initialize-it-using-for_loop.png\" alt=\"Array literal to initialize it using for_loop\" width=\"198\" height=\"172\" \/><\/a><\/p>\n<p>Here, as you can see we have initialized the array using for loop. Each element \u2018i\u2019 of the array is initialized with value = i+1. Apart from using the above method to initialize arrays, you can also make use of some of the methods of \u2018Arrays\u2019 class of \u2018java.util\u2019 package to provide initial values for the array.<\/p>\n<p>We will discuss some of these methods below.<\/p>\n<h4>#2) Using Arrays.fill()<\/h4>\n<p>The fill() method of the \u2018Arrays\u2019 class can be used to initialize the array. When you initialize an array using this method, the array is filled with the same values at all indices.<\/p>\n<p><span style=\"text-decoration: underline;\"><strong>Given below is the programming example.<\/strong><\/span><\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\nimport java.util.*;\r\npublic class Main\r\n{\r\n      public static void main(String&#x5B;] args)\r\n      {\r\n\t  int&#x5B;] oddArray;\r\n\t  oddArray = new int&#x5B;5];\r\n      \/\/fill the array with value 30\t\r\n     Arrays.fill(oddArray, 30);\r\n     System.out.println(&quot;Array Elements initialised with Arrays.fill:&quot;);\r\n     for(int i=0;i&lt;5;i++)\r\n\t  System.out.println(&quot;oddArray&#x5B;&quot; + i +&quot;] = &quot; + oddArray&#x5B;i]);\r\n      }\r\n}\r\n<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2019\/12\/Fill-method-of-Arrays_class.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-113967\" src=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2019\/12\/Fill-method-of-Arrays_class.png\" alt=\"Fill method of Arrays_class\" width=\"452\" height=\"214\" srcset=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2019\/12\/Fill-method-of-Arrays_class.png 452w, https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2019\/12\/Fill-method-of-Arrays_class-300x142.png 300w\" sizes=\"(max-width: 452px) 100vw, 452px\" \/><\/a><\/p>\n<p>In the above program, we have provided 30 as the value to be filled for the array. The output shows that all the elements in the array have value as 30.<\/p>\n<h4>#3) Using Arrays.copyOf()<\/h4>\n<p>Using the method \u2018copyOf()\u2019, we use a source array and then copy its values into a new array. You can specify how many values are to be copied and then the remaining elements of the array will have default values.<\/p>\n<p><strong>Check the following program.<\/strong><\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\nimport java.util.*;\r\npublic class Main\r\n{\r\n      public static void main(String&#x5B;] args)\r\n      {\r\n\t  int evenArray&#x5B;] = { 2,4,6,8,10 };\r\n\t  \/\/copy contents of evenArray to copyof_Array\r\n\t  int&#x5B;] copyof_Array = Arrays.copyOf(evenArray,5);\r\n          System.out.println(&quot;Array Elements initialised with Arrays.copyOf:&quot;);\r\n          \/\/print the array elements\r\n\t  for(int i=0;i&lt;5;i++)\r\n\t       System.out.println(&quot;copyof_Array&#x5B;&quot; + i +&quot;] = &quot; + copyof_Array&#x5B;i]);\r\n        }\r\n}\r\n<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2019\/12\/Using_Arrays.copyOf.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-113968\" src=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2019\/12\/Using_Arrays.copyOf.png\" alt=\"Using_Arrays.copyOf\" width=\"452\" height=\"200\" srcset=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2019\/12\/Using_Arrays.copyOf.png 452w, https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2019\/12\/Using_Arrays.copyOf-300x133.png 300w\" sizes=\"(max-width: 452px) 100vw, 452px\" \/><\/a><\/p>\n<p>In this program, we use a source array named \u2018evenArray\u2019. Using the copyOf method we have copied all the elements of evenArray into the new array. In the output, we display the contents of the new array which are the same as evenArray.<\/p>\n<p>Apart from the above two methods we just discussed that there are more methods like the setAll () method of Arrays class and clone() method of ArrayUtils that can be used to initialize arrays. We will take up these methods later in this tutorial series in the respective topics.<\/p>\n<h3>Frequently Asked Questions<\/h3>\n<p><strong>Q #1) Can we declare an Array without size?<\/strong><\/p>\n<p><strong>Answer:<\/strong> Yes. We can declare an array without size but before using it needs to be initialized.<\/p>\n<p><strong>Q #2) Is Array size fixed in Java?<\/strong><\/p>\n<p><strong>Answer:<\/strong> Yes. Arrays are static in Java and you declare an array with a specified size. Once this size is specified, you cannot change it again.<\/p>\n<p><strong>Q #3) Is it always necessary to use new while initializing arrays?<\/strong><\/p>\n<p><strong>Answer: <\/strong>No. Arrays can be initialized using new or by assigning comma-separated values enclosed in curly braces.<\/p>\n<p>So when we initialize an array using Array literal as shown below. You do not need to use new ones.<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">int&#x5B;] myarray = {1,2,3,4,5};<\/pre>\n<p>The number of elements provided will determine the size of the array.<\/p>\n<p><strong>Q #4) Is Java Array serializable?<\/strong><\/p>\n<p><strong>Answer:<\/strong> Yes. Internally the Array in Java implements the serializable interface.<\/p>\n<p><strong>Q #5) Is an Array Primitive data type?<\/strong><\/p>\n<p><strong>Answer:<\/strong> No. In fact, an array is not a data type at all. An array is a container object that holds the elements of specific data types in contiguous memory locations.<\/p>\n<h3>Conclusion<\/h3>\n<p>This sums up the creation and initialization of arrays in Java. Once the arrays are created and initialized to some values, we need to print them. For printing the array elements, we need to traverse the entire array and print elements.<\/p>\n<p><em><strong>We will look into some of the methods of printing array elements in our next tutorial.<\/strong><\/em><\/p>\n\r\n\t\t\t<div id=\"daexthefup-container\"\r\n\t\t\t\tclass=\"daexthefup-container daexthefup-layout-stacked daexthefup-alignment-center\"\r\n\t\t\t\tdata-post-id=\"113938\">\r\n\r\n\t\t\t\t<div class=\"daexthefup-feedback\">\r\n\t\t\t\t\t<div class=\"daexthefup-text\">\r\n\t\t\t\t\t\t<h3 class=\"daexthefup-title\">Was this helpful?<\/h3>\r\n\t\t\t\t\t<\/div>\r\n\t\t\t\t\t<div class=\"daexthefup-buttons-container\">\r\n\t\t\t\t\t\t<div class=\"daexthefup-buttons\">\r\n\t\t\t\t\t\t\t\r\n\t\t\t<div class=\"daexthefup-yes daexthefup-button daexthefup-button-type-icon\" data-value=\"1\">\r\n\t\t\t\t\r\n                <svg>\r\n                    <defs>\r\n                        <style>.thumb-up-cls-1{fill:#c9c9c9;}.thumb-up-cls-2{fill:#e1e1e1;}.thumb-up-cls-3{fill:#676767;}<\/style>\r\n                    <\/defs>\r\n                    <g id=\"thumb_up\">\r\n                        <path class=\"thumb-up-cls-2 daexthefup-icon-circle\" d=\"m24,3c11.58,0,21,9.42,21,21s-9.42,21-21,21S3,35.58,3,24,12.42,3,24,3m0-1C11.85,2,2,11.85,2,24s9.85,22,22,22,22-9.85,22-22S36.15,2,24,2h0Z\" \/>\r\n                        <g>\r\n                            <rect class=\"thumb-up-cls-3 daexthefup-icon-secondary-color\" x=\"10\" y=\"20\" width=\"6\" height=\"15\" rx=\"1.5\" ry=\"1.5\" \/>\r\n                            <path class=\"thumb-up-cls-1 daexthefup-icon-primary-color\" d=\"m30.57,9.06l-.49-.1c-.81-.17-1.61.35-1.78,1.16l-5.3,11.74c-.17.81,3.16,1.61,3.97,1.78l1.96.41c.81.17,1.61-.35,1.78-1.16l2.18-10.27c.34-1.61-.7-3.21-2.31-3.56Z\" \/>\r\n                            <path class=\"thumb-up-cls-1 daexthefup-icon-primary-color\" d=\"m38.17,20h-18.67c-.83,0-1.5.67-1.5,1.5v12c0,.83.67,1.5,1.5,1.5h16.27c.71,0,1.33-.5,1.47-1.21l2.4-12c.19-.93-.53-1.8-1.47-1.8Z\" \/>\r\n                        <\/g>\r\n                    <\/g>\r\n                <\/svg>\t\t\t<\/div>\r\n\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t<div class=\"daexthefup-no daexthefup-button daexthefup-button-type-icon\" data-value=\"0\">\r\n\t\t\t\t\r\n                <svg>\r\n                    <defs>\r\n                        <style>.thumb-down-cls-1{fill:#c9c9c9;}.thumb-down-cls-2{fill:#e1e1e1;}.thumb-down-cls-3{fill:#676767;}<\/style>\r\n                    <\/defs>\r\n                    <g id=\"thumb_down\">\r\n                        <path class=\"thumb-down-cls-2 daexthefup-icon-circle\" d=\"m24,3c11.58,0,21,9.42,21,21s-9.42,21-21,21S3,35.58,3,24,12.42,3,24,3m0-1C11.85,2,2,11.85,2,24s9.85,22,22,22,22-9.85,22-22S36.15,2,24,2h0Z\" \/>\r\n                        <g>\r\n                            <rect class=\"thumb-down-cls-3 daexthefup-icon-secondary-color\" x=\"10\" y=\"13\" width=\"6\" height=\"15\" rx=\"1.5\" ry=\"1.5\" \/>\r\n                            <path class=\"thumb-down-cls-1 daexthefup-icon-primary-color\" d=\"m30.57,38.94l-.49.1c-.81.17-1.61-.35-1.78-1.16l-5.3-11.74c-.17-.81,3.16-1.61,3.97-1.78l1.96-.41c.81-.17,1.61.35,1.78,1.16l2.18,10.27c.34,1.61-.7,3.21-2.31,3.56Z\" \/>\r\n                            <path class=\"thumb-down-cls-1 daexthefup-icon-primary-color\" d=\"m38.17,28h-18.67c-.83,0-1.5-.67-1.5-1.5v-12c0-.83.67-1.5,1.5-1.5h16.27c.71,0,1.33.5,1.47,1.21l2.4,12c.19.93-.53,1.8-1.47,1.8Z\" \/>\r\n                        <\/g>\r\n                    <\/g>\r\n                <\/svg>\t\t\t<\/div>\r\n\r\n\t\t\t\t\t\t\t\t\t<\/div>\r\n\t\t\t\t\t<\/div>\r\n\t\t\t\t<\/div>\r\n\r\n\t\t\t\t<div class=\"daexthefup-comment\">\r\n\t\t\t\t\t<div class=\"daexthefup-comment-top-container\">\r\n\t\t\t\t\t\t<label id=\"daexthefup-comment-label\" class=\"daexthefup-comment-label\"><\/label>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"daexthefup-comment-character-counter-container\">\r\n\t\t\t\t\t\t\t\t<div id=\"daexthefup-comment-character-counter-number\"\r\n\t\t\t\t\t\t\t\t\tclass=\"daexthefup-comment-character-counter-number\"><\/div>\r\n\t\t\t\t\t\t\t\t<div class=\"daexthefup-comment-character-counter-text\"><\/div>\r\n\t\t\t\t\t\t\t<\/div>\r\n\t\t\t\t\t\t\t\t\t\t\t<\/div>\r\n\t\t\t\t\t<textarea id=\"daexthefup-comment-textarea\" class=\"daexthefup-comment-textarea\"\r\n\t\t\t\t\t\t\t\tplaceholder=\"Type your message\"\r\n\t\t\t\t\t\t\t\tmaxlength=\"\r\n\t\t\t\t\t\t\t\t400\t\t\t\t\t\t\t\t\t\"><\/textarea>\r\n\t\t\t\t\t<div class=\"daexthefup-comment-buttons-container\">\r\n\t\t\t\t\t\t<button class=\"daexthefup-comment-submit daexthefup-button\">Submit<\/button>\r\n\t\t\t\t\t\t<button class=\"daexthefup-comment-cancel daexthefup-button\">Cancel<\/button>\r\n\t\t\t\t\t<\/div>\r\n\t\t\t\t<\/div>\r\n\r\n\t\t\t\t<div class=\"daexthefup-successful-submission-text\">Thanks for your feedback!<\/div>\r\n\r\n\t\t\t<\/div>\r\n\r\n\t\t\t","protected":false},"excerpt":{"rendered":"<p>This In-depth Tutorial Explains Various Ways to Declare, Create and Initialize a New Array With Values in Java with the Help of Simple Code Examples: In our previous tutorial, we discussed the basics of arrays in Java along with the different concepts associated with arrays which we will learn in &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Java Array &#8211; Declare, Create &#038; Initialize An Array In Java\" class=\"read-more button\" href=\"https:\/\/www.softwaretestinghelp.com\/java\/java-array-declare-create-initialize\/#more-113938\" aria-label=\"Read more about Java Array &#8211; Declare, Create &#038; Initialize An Array In Java\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":113969,"parent":38027,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"_acf_changed":false,"_helpful_pro_status":1,"footnotes":""},"categories":[408],"tags":[],"class_list":{"0":"post-113938","1":"page","2":"type-page","3":"status-publish","4":"has-post-thumbnail","6":"category-java"},"acf":[],"_links":{"self":[{"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/pages\/113938","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/comments?post=113938"}],"version-history":[{"count":0,"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/pages\/113938\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/pages\/38027"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/media\/113969"}],"wp:attachment":[{"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/media?parent=113938"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/categories?post=113938"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/tags?post=113938"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}