- Home
- Course Category
- Course Result
- Course Detail
Hot Line: 0124-2383121
Course Introduction
Includes
Certificate & Practice Material
Programs for practice
In the program below, we've introduced beginers to programming in java
Source Code: Program to find sum of matrices
There are following ways to print an array in Java:
Java for loop
Java for-each loop
Java Arrays.toString() method
Java Arrays.deepToString() method
Java Arrays.asList() method
Java for loop
public class PrintArrayExample1
{
public static void main(String args[])
{
//declaration and instantiation of an array
int arr[]=new int[4];
//initializing elements
arr[0]=10;
arr[1]=20;
arr[2]=70;
arr[3]=40;
//traversing over array using for loop
for(int i=0;iOutput
Run the program to see the OUTPUT