+ 3
How to print an array using loop by user in java
3 Answers
+ 8
int A[]= new A{12,23,54,14,21};
for (int i=0; i<=A.length - 1; i++)
{
System.out.println(A[i]);
}
Copy and paste it ............
+ 1
if loop is not necessary, for print array you can do this
import java.util.Arrays;
public class Program {
public static void main(String[] args) {
int[] a = new int[] {12,23,54,14,21};
System.out.println(Arrays.toString(a) );
}
}