[JAVA] How to output standard from an array with forEach

How to output standard from an array with forEach.

The contents of the array a are received by the variable i, the array elements are given by the add method, and the standard output is performed in order by forEach.

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        String[] a = {"Blue", "village", "Wise"}; 
        
        ArrayList<String> numbersList = new ArrayList<>();
        
        for(String i : a) {
            numbersList.add(i);
        }
        
        numbersList.stream().forEach((i) -> { System.out.print(i); });
        
    }
}

Recommended Posts

How to output standard from an array with forEach
How to crop an image with libGDX
How to output the value when there is an array in the array
From terminal to Ruby (standard input / output)
[Swift] Summary of how to remove elements from an array (personal note)
[Java] How to turn a two-dimensional array with an extended for statement
How to convert an array of Strings to an array of objects with the Stream API
I want to ForEach an array with a Lambda expression in Java
[Java] How to get and output standard input
How to use an array for HashMap keys
[Rails] How to build an environment with Docker
[ruby] How to receive values from standard input?
Learning Ruby with AtCoder 12 How to use standard output properly (p / puts / print)
[Ruby] How to use standard output in conditional branching
Output the maximum value from the array using Java standard output
How to push an app developed with Rails to Github
How to make an almost static page with rails
How to write to apply gem Pagy (pagination) to an array
[Java] How to encrypt with AES encryption with standard library
How to query Array in jsonb with Rails + postgres
How to get jdk etc from oracle with cli
How to request by passing an array to the query with HTTP Client of Ruby
How to create an application
How to number (number) with html.erb
How to update with activerecord-import
How to handle an instance
How to migrate from JUnit4 to JUnit5
How to initialize Java array
Output embedded Tomcat access log to standard output with Spring Boot
Let's write how to make API with SpringBoot + Docker from 0
How to divide a two-dimensional array into four with ruby
[iOS] [Objective-C] How to update a widget from an Objective-C app
How to change a string in an array to a number in Ruby
How to retrieve the hash value in an array in Ruby
Learning Ruby with AtCoder 13 How to make a two-dimensional array
How to specify db when creating an app with rails
How to output array values without using a for statement
How to make an app using Tensorflow with Android Studio
[Integration test code] How to select an element from date_select
[Java] I want to test standard input & standard output with JUnit
[Ruby] How to batch convert strings in an array to numbers
[Ruby] How to extract a specific value from an array under multiple conditions [select / each]
How to scroll horizontally with ScrollView
[Ruby] How to count even or odd numbers in an array
How to push from Tarminal to GitHub
How to get started with slim
I want to convert an array to Active Record Relation with Rails
[Swift5] How to get an array and the complement of arrays
How to enclose any character with "~"
Android: How to deal with "Could not determine java version from '10 .0.1'"
How to use mssql-tools with alpine
How to insert an external library
[Java] How to search for a value in an array (or list) with the contains method
The story of toString () starting with passing an array to System.out.println
How to get along with Rails
How to build an Apache Flink application from scratch in 5 minutes
How to open a script file from Ubuntu with VS code
How to convert param to hash with Rails controller (updated from time to time)
Learning Ruby with AtCoder 11 How to receive frequently used standard input
[Java] Conversion from array to List
Update MySQL from 5.7 to 8.0 with Docker