@@ -43,7 +43,7 @@ public class PrintArray {
4343** Output**
4444
4545```
46- Elements of the array are as give below:
46+ Elements of the array are given below:
47471
48485
49496
@@ -61,7 +61,7 @@ Elements of the array are as give below:
6161
6262We have a ready-made method to print an array in Java.
6363
64- ` Arrays.toString() ` method expects an array to be printed as an input parameter and returns a string of array elements.
64+ The ` Arrays.toString() ` method expects an array to be printed as an input parameter and returns a string of array elements.
6565
6666Input param - array to be print
6767
@@ -132,23 +132,23 @@ Elements of the multi-dimensional array are given below:
132132
133133## 4. Print an array using Java 8 Streams
134134
135- In Java 8 Streams, we can use the ` foreach ()` method to print each element of an array.
135+ In Java 8 Streams, we can use the ` forEach ()` method to print each element of an array.
136136
137137** Java Program**
138138
139139``` java
140140import java.util.Arrays ;
141141
142142/**
143- * Java program to print an array using Java 8 Streams foreach method
143+ * Java program to print an array using Java 8 Streams forEach() method
144144 * By coderolls.com
145145 */
146146public class PrintArray4 {
147147
148148 public static void main (String [] args ) {
149149 int [] arr = {1 , 5 , 8 , 7 , 2 , 6 , 9 , 6 };
150150
151- System . out. println(" Elements of the array are as given below: " );
151+ System . out. println(" Elements of the array are given below: " );
152152 Arrays . stream(arr). forEach(System . out:: println);
153153 }
154154}
@@ -157,7 +157,7 @@ public class PrintArray4 {
157157** Output**
158158
159159```
160- Elements of the array are as given below:
160+ Elements of the array are given below:
1611611
1621625
1631638
@@ -167,4 +167,3 @@ Elements of the array are as given below:
1671679
1681686
169169```
170-
0 commit comments