About 10,400,000 results
Open links in new tab
  1. How to Take Array Input From User in Java? - GeeksforGeeks

    Apr 17, 2025 · Arrays in Java are an important data structure, and we can add elements to them by taking input from the user. There is no direct method to take input from the user, but we can …

  2. How to Take Array Input in Java - Tpoint Tech

    To take input of an array, we must ask the user about the length of the array. After that, we use a Java for loop to take the input from the user and the same for loop is also used for retrieving …

  3. how to take user input in Array using java? - Stack Overflow

    May 15, 2011 · Here's a simple code that reads strings from stdin, adds them into List<String>, and then uses toArray to convert it to String[] (if you really need to work with arrays). public …

  4. java - How to put a Scanner input into an array... for example a …

    Jul 10, 2018 · import java.util.Scanner; import java.util.ArrayList; public class Main { public static void main (String[]args) { System.out.println("Introduce the sequence of numbers to store in …

  5. java - Enter array without knowing its size - Stack Overflow

    Dec 15, 2018 · Is there a way to make an array in Java, without defining or asking for its length first? A.k.a the user enters some numbers as arguments, and the program creates an array …

  6. How to take array input in Java - BeginnersBook

    Jun 1, 2024 · In this guide, you will learn how to take 1D array and 2D array input in Java. We will be using for loop and Scanner class to accomplish this. array[i] = scanner.nextInt(); …

  7. Java User Input – Scanner Class - GeeksforGeeks

    Apr 22, 2025 · An array in Java is a linear data structure, which is used to store multiple values of the same data type. In array each element has a unique index value, which makes it easy to …

  8. Java Program to Get Array Input - Javacodepoint

    Dec 14, 2024 · This post shows you multiple approaches to get array input in Java. 1. Using a Static Array (Hardcoded Values) This is the simplest way to initialize values directly in the array.

  9. Storing Java Scanner Input in an Array - Baeldung

    Nov 29, 2023 · In this tutorial, we’ll explore how to save scanner input in an array in Java. 2. Introduction to the Problem. There can be three scenarios when we store the input from a …

  10. Write a Java Program to input and print n elements in an array

    Jan 25, 2017 · How to input and display elements in an array using for loop in java programming. Array uses an index based mechanism for fast and easy accessing of elements. Array index …

  11. Some results have been removed
Refresh