Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

putting scanner into an array

public static void main (String[] args)
{
    Scanner input = new Scanner(System.in);//create an object type Scanner which called "input"
    double[] numbers = new double[5];//creating an array type double

    for (int i = 0; i < numbers.length; i++)
    {
        System.out.println("Please enter number");
        numbers[i] = input.nextDouble();
    }
}
Comment

PREVIOUS NEXT
Code Example
Java :: clear text field in java 
Java :: how to iterate list of string array in java 
Java :: n queens problem leetcode 
Java :: string remove last character 
Java :: java get file from url 
Java :: can we create a class inside a class in java 
Java :: initialize hashset with values java 9 
Java :: java parse unix timestamp 
Java :: bubble sort for java ArrayList 
Java :: java divisible by operator 
Java :: check have string have just numbers 
Java :: java detect new line in string 
Java :: JAVA HashMap get keys by values 
Java :: get average of all the array items android 
Java :: java create list integer range 
Java :: java text file to arraylist 
Java :: retrofit implementation 
Java :: java how to make a number 
Java :: java does file exist 
Java :: materialbutton remove shadow xml 
Java :: java restart while loop 
Java :: How to print in console java 
Java :: How to initialize a 2d array in Java? 
Java :: fileinputstream 
Java :: java eclipse console clear 
Java :: javafx text wrapping 
Java :: build.plugins.plugin.version 
Java :: generate serial uuid with intelij 
Java :: retrofit android 
Java :: if is true javascrtiptr 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =