		
		{"id":18331,"date":"2024-04-24T10:20:04","date_gmt":"2024-04-24T10:20:04","guid":{"rendered":"http:\/\/localhost\/netizens_12_aug\/?p=11624"},"modified":"2024-04-24T10:20:04","modified_gmt":"2024-04-24T10:20:04","slug":"how-to-initialize-an-array","status":"publish","type":"post","link":"https:\/\/netizens.netizens.dev\/br\/blog\/how-to-initialize-an-array\/","title":{"rendered":"The Complete Guide to Initializing Arrays in Java"},"content":{"rendered":"<p>Java arrays are data structures of a fixed size. The most important process is initializing arrays in Java, which involves allocating memory for the array and (optionally) assigning initial values. Failing to properly initialize an array reference in Java will result in a compilation error if you try to use it.<\/p>\n<p><span style=\"font-weight: 400;\">In Java programming, there are four major and unique ways of array initiation, each with its unique meaning.<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">Method 1: The Three-Step Process (Declaration, Allocation, and Assignment)<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">This method is the least implicit, and it clearly illustrates how the definition of the reference, reservation of memory, and assigning values are clearly distinct. <\/span>You generally use this method when the size is known but the values will be determined later, usually within a loop or from user input.<\/p>\n<h3><span style=\"font-weight: 400;\">Step 1: Declaration<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">You declare the array reference variable, defining the data type of the elements it will hold.<\/span><\/p>\n<div style=\"background: #000; color: #fff; font-weight: bold; padding: 6px 12px; font-size: 16px;\">Java<\/div>\n<pre style=\"background: #f8f8f8; color: #333; padding: 0 12px 12px 12px; margin: 0; font-size: 18px; line-height: 1.5; overflow-x: auto;\"><code>\n<span style=\"color: #0000cc; font-weight: bold;\">int<\/span>[] studentScores;\n<span style=\"color: #999;\">\/\/ or the less common C-style<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">String<\/span> names[];\n<\/code><\/pre>\n<h3><span style=\"font-weight: 400;\">Step 2: Allocation (Instantiation)<\/span><\/h3>\n<p>You use the <code data-start=\"12\" data-end=\"17\">new<\/code> keyword to instantiate the array object, reserving a contiguous block of memory on the heap and specifying the array&#8217;s fixed size.<\/p>\n<div style=\"background: #000; color: #fff; font-weight: bold; padding: 6px 12px; font-size: 16px;\">Java<\/div>\n<pre style=\"background: #f8f8f8; color: #333; padding: 0 12px 12px 12px; margin: 0; font-size: 18px; line-height: 1.5; overflow-x: auto;\"><code>\n<span style=\"color: #999;\">\/\/ Reserves space for 5 integers<\/span>\nstudentScores = <span style=\"color: #0000cc; font-weight: bold;\">new int[5]<\/span>;\n<\/code><\/pre>\n<h4><span style=\"font-weight: 400;\">Memory and Default Values<\/span><\/h4>\n<p><span style=\"font-weight: 400;\">When you allocate memory, Java guarantees that all array elements are automatically initialized to a default value corresponding to their data type. This prevents unexpected behavior from uninitialized memory locations.<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Numeric Types<\/b><span style=\"font-weight: 400;\"> (<\/span><span style=\"font-weight: 400;\">int<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">double<\/span><span style=\"font-weight: 400;\">, etc.): 0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>boolean<\/b><span style=\"font-weight: 400;\">: false<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>char<\/b><span style=\"font-weight: 400;\">: \u20320\u02d8000\u2032 (The Null character)<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Reference Types<\/b><span style=\"font-weight: 400;\"> (<\/span><span style=\"font-weight: 400;\">String<\/span><span style=\"font-weight: 400;\">, Objects): null<\/span><\/li>\n<\/ul>\n<h3><span style=\"font-weight: 400;\">Step 3: Explicit Assignment<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">You manually assign values to specific indices, where indices range from 0 to length\u22121.<\/span><\/p>\n<div style=\"background: #000; color: #fff; font-weight: bold; padding: 6px 12px; font-size: 16px;\">Java<\/div>\n<pre style=\"background: #f8f8f8; color: #333; padding: 0 12px 12px 12px; margin: 0; font-size: 18px; line-height: 1.5; overflow-x: auto;\"><code>\nstudentScores[0] = 95;   <span style=\"color: #999;\">\/\/ The first element<\/span>\nstudentScores[1] = 88;\n<span style=\"color: #999;\">\/\/ ...<\/span>\nstudentScores[4] = 92;   <span style=\"color: #999;\">\/\/ The last element<\/span>\n<\/code><\/pre>\n<p><span style=\"font-weight: 400;\">Attempting to access studentScores[5] would result in an ArrayIndexOutOfBoundsException at runtime, as the maximum index is 4.<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">Method 2: The Array Initializer Block<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">This method is the preferred way of initializing arrays in Java when all array elements are known at the time of declaration, combining declaration, allocation, and initialization in a single, concise statement.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Here, the new data type [size] part is omitted, and the Java compiler implicitly assigns the size depending on the number of values given in the curly braces.<\/span><\/p>\n<div style=\"background: #000; color: #fff; font-weight: bold; padding: 6px 12px; font-size: 16px;\">Java<\/div>\n<pre style=\"background: #f8f8f8; color: #333; padding: 0 12px 12px 12px; margin: 0; font-size: 18px; line-height: 1.5; overflow-x: auto;\"><code>\n<span style=\"color: #999;\">\/\/ The size is automatically set to 4<\/span>\nString[] flavors = {\"Vanilla\", \"Chocolate\", \"Strawberry\", \"Mint\"};\n\n<span style=\"color: #999;\">\/\/ The size is automatically set to 5<\/span>\ndouble[] percentages = {10.5, 20.0, 33.3, 40.0, 50.0};\n<\/code><\/pre>\n<h2><span style=\"font-weight: 400;\">Method 3: Using the new Keyword with an Initializer Block<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">This method is a hybrid: it uses the array initializer block but also explicitly includes the new dataType[] keyword. While less common for simple declarations, it&#8217;s necessary for creating anonymous arrays.<\/span><\/p>\n<div style=\"background: #000; color: #fff; font-weight: bold; padding: 6px 12px; font-size: 16px;\">Java<\/div>\n<pre style=\"background: #f8f8f8; color: #333; padding: 0 12px 12px 12px; margin: 0; font-size: 18px; line-height: 1.5; overflow-x: auto;\"><code>\n<span style=\"color: #999;\">\/\/ Explicitly using 'new'<\/span>\nchar[] letters = new char[]{'A', 'B', 'C'};\n<\/code><\/pre>\n<h3><span style=\"font-weight: 400;\">The Power of Anonymous Arrays<\/span><\/h3>\n<p>You create and initialize an anonymous array without assigning it to a reference variable. Since it has no name, you can use it only immediately after creation, typically when passing temporary data to a method.<\/p>\n<div style=\"background: #000; color: #fff; font-weight: bold; padding: 6px 12px; font-size: 16px;\">Java<\/div>\n<pre style=\"background: #f8f8f8; color: #333; padding: 0 12px 12px 12px; margin: 0; font-size: 18px; line-height: 1.5; overflow-x: auto;\"><code>\n<span style=\"color: #999;\">\/\/ Define a method that accepts an array<\/span>\npublic static int getSum(int[] data) {\n    int sum = 0;\n    for (int value : data) {\n        sum += value;\n    }\n    return sum;\n}\n<span style=\"color: #999;\">\/\/ Pass an anonymous array to the method<\/span>\nint total = getSum(new int[]{5, 10, 15, 20});\nSystem.out.println(\"Total: \" + total);\n<\/code><\/pre>\n<p><strong>Output:<\/strong><\/p>\n<div style=\"background-color: #e0e0e0; padding: 20px 20px; border-radius: 6px; margin-bottom: 5px;\">50<\/div>\n<h2><span style=\"font-weight: 400;\">4. Initializing Multidimensional Arrays<\/span><\/h2>\n<p>You initialize multidimensional arrays (arrays of arrays, commonly 2D) using nested braces.<\/p>\n<h3><span style=\"font-weight: 400;\">A. Initialization with Known Values<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">For a standard matrix structure, you nest the initializer blocks:<\/span><\/p>\n<div style=\"background: #000; color: #fff; font-weight: bold; padding: 6px 12px; font-size: 16px;\">Java<\/div>\n<pre style=\"background: #f8f8f8; color: #333; padding: 0 12px 12px 12px; margin: 0; font-size: 18px; line-height: 1.5; overflow-x: auto;\"><code>\n<span style=\"color: #999;\">\/\/ A 3x3 matrix (3 rows, 3 columns)<\/span>\nint[][] matrix = {\n    {1, 2, 3},\n    {4, 5, 6},\n    {7, 8, 9}\n};\n<span style=\"color: #999;\">\/\/ Access: matrix[1][2] is 6 (Row 1, Column 2)<\/span>\n<\/code><\/pre>\n<h3><span style=\"font-weight: 400;\">B. Initializing Jagged Arrays (Arrays of Unequal Length)<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">Java allows the sub-arrays to have different lengths; these are called jagged arrays. You must specify the size of the <\/span><i><span style=\"font-weight: 400;\">first<\/span><\/i><span style=\"font-weight: 400;\"> dimension (the number of rows), but you can leave the second dimension blank.<\/span><\/p>\n<div style=\"background: #000; color: #fff; font-weight: bold; padding: 6px 12px; font-size: 16px;\">Java<\/div>\n<pre style=\"background: #f8f8f8; color: #333; padding: 0 12px 12px 12px; margin: 0; font-size: 18px; line-height: 1.5; overflow-x: auto;\"><code>\n<span style=\"color: #999;\">\/\/ 1. Specify 3 rows, but leave column sizes open<\/span>\nint[][] jaggedArray = new int[3][];\n\n<span style=\"color: #999;\">\/\/ 2. Initialize each row separately with its own size\/values<\/span>\njaggedArray[0] = new int[]{10, 20, 30};       <span style=\"color: #999;\">\/\/ Length 3<\/span>\njaggedArray[1] = new int[]{40, 50};           <span style=\"color: #999;\">\/\/ Length 2<\/span>\njaggedArray[2] = new int[]{60, 70, 80, 90};   <span style=\"color: #999;\">\/\/ Length 4<\/span>\n\n<span style=\"color: #999;\">\/\/ Access: jaggedArray[1].length is 2<\/span>\n<\/code><\/pre>\n<p><b>Also Read:<\/b> <a href=\"https:\/\/netizens.netizens.dev\/br\/blog\/increment-and-decrement-operators-in-java\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">Increment and decrement operators in Java<\/span><\/a><\/p>\n<h2><span style=\"font-weight: 400;\">Summary of Initialization Techniques<\/span><\/h2>\n<div style=\"overflow-x: auto; margin: 10px 0;\">\n<table style=\"border-collapse: collapse; width: 100%;\">\n<thead>\n<tr style=\"background-color: #000; color: #fff; text-align: left;\">\n<th style=\"padding: 12px;\">Method<\/th>\n<th style=\"padding: 12px;\">Syntax<\/th>\n<th style=\"padding: 12px;\">Memory Allocation<\/th>\n<th style=\"padding: 12px;\">Best Use Case<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"background-color: #f8f9fa;\">\n<td style=\"padding: 12px;\">Separate Steps<\/td>\n<td style=\"padding: 12px;\">int[] a = new int[5]; a[0] = 1;<\/td>\n<td style=\"padding: 12px;\">Explicitly requires size definition.<\/td>\n<td style=\"padding: 12px;\">Size is known, but values are assigned dynamically (e.g., from user input or calculation).<\/td>\n<\/tr>\n<tr style=\"background-color: #ffffff;\">\n<td style=\"padding: 12px;\">Initializer Block<\/td>\n<td style=\"padding: 12px;\">int[] a = {1, 2, 3};<\/td>\n<td style=\"padding: 12px;\">Implicitly sized by the compiler.<\/td>\n<td style=\"padding: 12px;\">Values are fixed and known at the time of coding. (Recommended)<\/td>\n<\/tr>\n<tr style=\"background-color: #f8f9fa;\">\n<td style=\"padding: 12px;\">Anonymous Array<\/td>\n<td style=\"padding: 12px;\">method(new int[]{1, 2});<\/td>\n<td style=\"padding: 12px;\">Implicitly sized by the compiler.<\/td>\n<td style=\"padding: 12px;\">Passing a temporary array as a method argument without creating a persistent variable.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p><span style=\"font-weight: 400;\">By mastering these techniques for initializing arrays in Java, you ensure your programs handle array memory and data correctly, avoiding common pitfalls like NullPointerException and ArrayIndexOutOfBoundsException.<\/span><\/p>","protected":false},"excerpt":{"rendered":"<p>Java arrays are data structures of a fixed size. The most important process is initializing arrays in Java, which involves allocating memory for the array and (optionally) assigning initial values. Failing to properly initialize an array reference in Java will result in a compilation error if you try to use it. In Java programming, there [&hellip;]<\/p>","protected":false},"author":2,"featured_media":19044,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[176,1011],"tags":[1205,1206,1207,1208,1209,1210,1211],"class_list":["post-18331","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-information","category-other","tag-how-to-initialize-an-array-in-java","tag-how-to-initialize-an-array-in-java-constructor","tag-how-to-initialize-an-array-in-java-if-you-dont-know-max-length-string","tag-how-to-initialize-an-array-in-java-with-size","tag-how-to-initialize-an-array-in-java-with-unknown-size","tag-how-to-initialize-an-array-in-java-with-values","tag-how-to-initialize-an-array-in-java-without-size"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Initializing Arrays in Java: A Complete Beginner\u2019s Guide<\/title>\n<meta name=\"description\" content=\"Learn all about initializing arrays in Java with clear examples and methods to declare, allocate, and assign values efficiently.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/netizens.netizens.dev\/br\/blog\/how-to-initialize-an-array\/\" \/>\n<meta property=\"og:locale\" content=\"pt_BR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Initializing Arrays in Java: A Complete Beginner\u2019s Guide\" \/>\n<meta property=\"og:description\" content=\"Learn all about initializing arrays in Java with clear examples and methods to declare, allocate, and assign values efficiently.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/netizens.netizens.dev\/br\/blog\/how-to-initialize-an-array\/\" \/>\n<meta property=\"article:published_time\" content=\"2024-04-24T10:20:04+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/netizens.netizens.dev\/wp-content\/uploads\/2024\/04\/How-to-Initialize-an-Array-in-Java.png\" \/>\n\t<meta property=\"og:image:width\" content=\"645\" \/>\n\t<meta property=\"og:image:height\" content=\"360\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"admin admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Escrito por\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. tempo de leitura\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/netizens.netizens.dev\/blog\/how-to-initialize-an-array\/\",\"url\":\"https:\/\/netizens.netizens.dev\/blog\/how-to-initialize-an-array\/\",\"name\":\"Initializing Arrays in Java: A Complete Beginner\u2019s Guide\",\"isPartOf\":{\"@id\":\"https:\/\/netizens.netizens.dev\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/netizens.netizens.dev\/blog\/how-to-initialize-an-array\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/netizens.netizens.dev\/blog\/how-to-initialize-an-array\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/netizens.netizens.dev\/wp-content\/uploads\/2024\/04\/How-to-Initialize-an-Array-in-Java.png\",\"datePublished\":\"2024-04-24T10:20:04+00:00\",\"dateModified\":\"2024-04-24T10:20:04+00:00\",\"author\":{\"@id\":\"https:\/\/netizens.netizens.dev\/#\/schema\/person\/5db7227e686a10a4126a2c19b8b70517\"},\"description\":\"Learn all about initializing arrays in Java with clear examples and methods to declare, allocate, and assign values efficiently.\",\"breadcrumb\":{\"@id\":\"https:\/\/netizens.netizens.dev\/blog\/how-to-initialize-an-array\/#breadcrumb\"},\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/netizens.netizens.dev\/blog\/how-to-initialize-an-array\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\/\/netizens.netizens.dev\/blog\/how-to-initialize-an-array\/#primaryimage\",\"url\":\"https:\/\/netizens.netizens.dev\/wp-content\/uploads\/2024\/04\/How-to-Initialize-an-Array-in-Java.png\",\"contentUrl\":\"https:\/\/netizens.netizens.dev\/wp-content\/uploads\/2024\/04\/How-to-Initialize-an-Array-in-Java.png\",\"width\":645,\"height\":360,\"caption\":\"How to initialize an array in java\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/netizens.netizens.dev\/blog\/how-to-initialize-an-array\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/netizens.netizens.dev\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"The Complete Guide to Initializing Arrays in Java\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/netizens.netizens.dev\/#website\",\"url\":\"https:\/\/netizens.netizens.dev\/\",\"name\":\"\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/netizens.netizens.dev\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"pt-BR\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/netizens.netizens.dev\/#\/schema\/person\/5db7227e686a10a4126a2c19b8b70517\",\"name\":\"admin admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\/\/netizens.netizens.dev\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/b0f87bbe7cdbfbd534a40fea7d9d02021e6d3772c3949940e8de2e3df278fb2f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/b0f87bbe7cdbfbd534a40fea7d9d02021e6d3772c3949940e8de2e3df278fb2f?s=96&d=mm&r=g\",\"caption\":\"admin admin\"},\"sameAs\":[\"https:\/\/netizens.netizens.dev\"],\"url\":\"https:\/\/netizens.netizens.dev\/br\/blog\/author\/admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Initializing Arrays in Java: A Complete Beginner\u2019s Guide","description":"Learn all about initializing arrays in Java with clear examples and methods to declare, allocate, and assign values efficiently.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/netizens.netizens.dev\/br\/blog\/how-to-initialize-an-array\/","og_locale":"pt_BR","og_type":"article","og_title":"Initializing Arrays in Java: A Complete Beginner\u2019s Guide","og_description":"Learn all about initializing arrays in Java with clear examples and methods to declare, allocate, and assign values efficiently.","og_url":"https:\/\/netizens.netizens.dev\/br\/blog\/how-to-initialize-an-array\/","article_published_time":"2024-04-24T10:20:04+00:00","og_image":[{"width":645,"height":360,"url":"https:\/\/netizens.netizens.dev\/wp-content\/uploads\/2024\/04\/How-to-Initialize-an-Array-in-Java.png","type":"image\/png"}],"author":"admin admin","twitter_card":"summary_large_image","twitter_misc":{"Escrito por":"admin admin","Est. tempo de leitura":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/netizens.netizens.dev\/blog\/how-to-initialize-an-array\/","url":"https:\/\/netizens.netizens.dev\/blog\/how-to-initialize-an-array\/","name":"Initializing Arrays in Java: A Complete Beginner\u2019s Guide","isPartOf":{"@id":"https:\/\/netizens.netizens.dev\/#website"},"primaryImageOfPage":{"@id":"https:\/\/netizens.netizens.dev\/blog\/how-to-initialize-an-array\/#primaryimage"},"image":{"@id":"https:\/\/netizens.netizens.dev\/blog\/how-to-initialize-an-array\/#primaryimage"},"thumbnailUrl":"https:\/\/netizens.netizens.dev\/wp-content\/uploads\/2024\/04\/How-to-Initialize-an-Array-in-Java.png","datePublished":"2024-04-24T10:20:04+00:00","dateModified":"2024-04-24T10:20:04+00:00","author":{"@id":"https:\/\/netizens.netizens.dev\/#\/schema\/person\/5db7227e686a10a4126a2c19b8b70517"},"description":"Learn all about initializing arrays in Java with clear examples and methods to declare, allocate, and assign values efficiently.","breadcrumb":{"@id":"https:\/\/netizens.netizens.dev\/blog\/how-to-initialize-an-array\/#breadcrumb"},"inLanguage":"pt-BR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/netizens.netizens.dev\/blog\/how-to-initialize-an-array\/"]}]},{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/netizens.netizens.dev\/blog\/how-to-initialize-an-array\/#primaryimage","url":"https:\/\/netizens.netizens.dev\/wp-content\/uploads\/2024\/04\/How-to-Initialize-an-Array-in-Java.png","contentUrl":"https:\/\/netizens.netizens.dev\/wp-content\/uploads\/2024\/04\/How-to-Initialize-an-Array-in-Java.png","width":645,"height":360,"caption":"How to initialize an array in java"},{"@type":"BreadcrumbList","@id":"https:\/\/netizens.netizens.dev\/blog\/how-to-initialize-an-array\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/netizens.netizens.dev\/"},{"@type":"ListItem","position":2,"name":"The Complete Guide to Initializing Arrays in Java"}]},{"@type":"WebSite","@id":"https:\/\/netizens.netizens.dev\/#website","url":"https:\/\/netizens.netizens.dev\/","name":"","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/netizens.netizens.dev\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"pt-BR"},{"@type":"Person","@id":"https:\/\/netizens.netizens.dev\/#\/schema\/person\/5db7227e686a10a4126a2c19b8b70517","name":"admin admin","image":{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/netizens.netizens.dev\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/b0f87bbe7cdbfbd534a40fea7d9d02021e6d3772c3949940e8de2e3df278fb2f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b0f87bbe7cdbfbd534a40fea7d9d02021e6d3772c3949940e8de2e3df278fb2f?s=96&d=mm&r=g","caption":"admin admin"},"sameAs":["https:\/\/netizens.netizens.dev"],"url":"https:\/\/netizens.netizens.dev\/br\/blog\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/netizens.netizens.dev\/br\/wp-json\/wp\/v2\/posts\/18331","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/netizens.netizens.dev\/br\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/netizens.netizens.dev\/br\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/netizens.netizens.dev\/br\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/netizens.netizens.dev\/br\/wp-json\/wp\/v2\/comments?post=18331"}],"version-history":[{"count":0,"href":"https:\/\/netizens.netizens.dev\/br\/wp-json\/wp\/v2\/posts\/18331\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/netizens.netizens.dev\/br\/wp-json\/wp\/v2\/media\/19044"}],"wp:attachment":[{"href":"https:\/\/netizens.netizens.dev\/br\/wp-json\/wp\/v2\/media?parent=18331"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/netizens.netizens.dev\/br\/wp-json\/wp\/v2\/categories?post=18331"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/netizens.netizens.dev\/br\/wp-json\/wp\/v2\/tags?post=18331"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}