About 26,100 results
Open links in new tab
  1. 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 [ ] : We have now …

  2. Arrays in Java - GeeksforGeeks

    Feb 17, 2026 · When we use arrays of primitive types, the elements are stored in contiguous locations. For non primitive types, references to items are stored at contiguous locations. The first element of …

  3. 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).

  4. 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 …

  5. Java Array (With Examples) - Programiz

    In this tutorial, we will learn to work with Java arrays. We will learn to declare, initialize, and access array elements with the help of examples. An array is a collection of similar data types.

  6. 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 …

  7. Java arrays with Examples - CodeGym

    Apr 24, 2025 · How do you create an array? Like any other object, you can create a Java array, i.e. reserve a place in memory for it, using the new operator. This is how it's done: where typeOfArray is …

  8. Java Arrays - Online Tutorials Library

    Learn about Java arrays, including how to declare, initialize, and manipulate them in your Java applications.

  9. 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.

  10. Arrays (The Java™ Tutorials > Learning the Java Language - Oracle

    You can also declare an array of arrays (also known as a multidimensional array) by using two or more sets of brackets, such as String[][] names. Each element, therefore, must be accessed by a …