About 135,000 results
Open links in new tab
  1. How to Declare and Initialize an Array in Java - GeeksforGeeks

    Oct 11, 2025 · The array memory is allocated when you use the new keyword or assign values. Complete working Java example that demonstrates declaring, initializing, and accessing arrays

  2. How do I declare and initialize an array in Java? - Stack Overflow

    Jul 29, 2009 · You can either use array declaration or array literal (but only when you declare and affect the variable right away, array literals cannot be used for re-assigning an array).

  3. Initializing Arrays in Java - Baeldung

    Dec 16, 2024 · 1. Overview An array is a data structure that allows us to store and manipulate a collection of elements of the same data type. Arrays have a fixed size, determined during …

  4. Java Arrays - W3Schools

    Arrays are used to store multiple values in a single variable, instead of declaring separate variables for each value. To declare an array, define the variable type with square brackets [ ] :

  5. How to Create an Array in JavaArray Declaration Example

    Mar 16, 2023 · In this article, we will provide a step-by-step guide on how to create an array in Java, including how to initialize or create an array. We will also cover some advanced topics such as multi …

  6. Creating New Arrays in Java: A Comprehensive Guide

    Nov 12, 2025 · In this blog post, we will explore the different ways to create new arrays in Java, along with their usage methods, common practices, and best practices. In Java, an array is an object that …

  7. How to Declare and Initialize an Array in Java: A Complete Step-by …

    Dec 3, 2025 · This guide will walk you through everything you need to know about declaring and initializing arrays in Java, from basic syntax to advanced use cases like multi-dimensional arrays.

  8. Java Array – Declare, Create & Initialize An Array In Java

    Apr 1, 2025 · 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.

  9. Arrays in Java - GeeksforGeeks

    Jan 27, 2026 · In Java, an array is declared by specifying the data type, followed by the array name, and empty square brackets []. When an array is declared, only a reference is created. Memory is …

  10. How to create an Array in Java? - Online Tutorials Library

    In this article, we will learn to create an Array in Java. Arrays provide an efficient way to manage and access data collections, making them essential for many programming tasks.