Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

How do you input numbers into an array?

  public static void main(String[] args) {
      
        Scanner input = new Scanner(System.in);
      
        int[] xr = new int[5];

        for (int i = 0; i < xr.length; i++) {
            xr[i] = input.nextInt();
        }

        System.out.println(Arrays.toString(xr));
    }
Comment

PREVIOUS NEXT
Code Example
Java :: java formatted string input 
Java :: draw an icon in between swiped area android 
Java :: pgzint install windows 10 
Java :: missingWords 
Java :: build cmake gradle 
Java :: Deal with empty or blank cell in excel file using apache poi 
Java :: torres de hanoi java 
Java :: if(ResultSet.next()) 
Java :: Rotate Left k cells java 
Java :: compile time exception in java 
Java :: ternärer operator java 
Java :: material motion android navigation arch 
Java :: system.out.println(h [2] [1] [1] [0]); 
Java :: encode é to é java 
Java :: java pattern matching 
Java :: system program j 
Java :: RedisCacheManager json serializer 
Java :: clear array in java 
Java :: java focus to desktop 
Java :: getter and setter in java 
Java :: binary search tree 
Java :: java importing 
Java :: string split java 
Java :: java tutorialspoint 
Java :: nested for loop java 
Java :: Java Lambda Expressions with parameters 
Java :: postfix operator in java 
Java :: how do I test the reverse method in java using jest 
Sql :: mysql disable safe mode 
Sql :: sql find text in sp 
ADD CONTENT
Topic
Content
Source link
Name
1+3 =