About 3,370,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. Java program to read and print elements of one dim array

    Aug 16, 2024 · In this topic, we are going to learn how to read and print elements of a one dimensional array in Java programming language using loops. In this blog, We have already …

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

  4. How to take array input from command line in Java ? Scanner ... - Blogger

    Jul 2, 2016 · Depending on which type of array you are taking as input e.g. String or int or any other array, you need to use the next() or nextInt() method to read a value from the command …

  5. How to read input and print elements of an array in Java using …

    Jul 9, 2021 · In this post, we are going to learn how to write a program to read array input and print them in an array using for loop in Java language. In this code, we are going to learn how …

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

    Jul 10, 2018 · import java.util.Scanner; class Array { public static void main(String a[]){ Scanner input = new Scanner(System.in); System.out.println("Enter the size of an Array"); int num = …

  7. 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(); …

  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 …

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

  10. Java Array Programs | GeeksforGeeks

    Jun 22, 2024 · This article provides a variety of programs on arrays, including examples of operations such as sorting, merging, insertion, and deletion of elements in a single …

  11. Some results have been removed