About 2,510,000 results
Open links in new tab
  1. java - How to store numbers in an array? - Stack Overflow

    May 1, 2015 · To store userinputs to int array you can do. array[i]=scanner.nextInt(); If you want to store number from 0 to 19 you can do. array[i]=i; public static void main(String[] args) { int …

  2. Java Arrays - W3Schools

    Java Arrays. 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 …

  3. Arrays in Java - GeeksforGeeks

    Mar 28, 2025 · Arrays in Java are one of the most fundamental data structures that allow us to store multiple values of the same type in a single variable. They are useful for storing and …

  4. Array in Java: store multiple values in a single variable

    An array in Java is used to store multiple values in a single variable, instead of declaring separate variables for each value. In other words, an array is a collection of elements stored in what can …

  5. How to Create an Array in JavaArray Declaration Example

    Mar 16, 2023 · Arrays provide a way to store and organize multiple values of the same type, making it easier to work with large sets of data. In this article, we will provide a step-by-step …

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

    The following program, ArrayDemo, creates an array of integers, puts some values in the array, and prints each value to standard output. public static void main(String[] args) { // declares an …

  7. Java Array: A Complete Guide With Examples - The Knowledge …

    Apr 22, 2025 · Arrays in Java are a fundamental data structure that allows you to store multiple values of the same type in a single variable. This blog will guide you through the process of …

  8. Java Array | Java Tutorial Network

    Jan 6, 2015 · For example you may want to store all prices in a shop in one array. But what makes arrays really useful is the way you can work with the values stored into it. The genaral …

  9. 1.4 Arrays - Princeton University

    Apr 8, 2020 · In this section, we consider a fundamental construct known as the array. An array stores a sequence of values that are all of the same type. We want not just to store values but …

  10. java - How can I store multiple variable values into a single array

    Below is a demonstration of how I want the data to be stored. Kindly provide me with the simplest solution as possible. Thanks. Use a class and then a arraylist of that class. You could use an …

Refresh