Different ways of Initializing Arrays in Java

This video tutorial explains the different ways of initializing arrays in java programming.

You will learn what are arrays, how to create arrays, what are the different methods/ways of creating arrays with example in detail.



Source code for this video tutorial

package learningJava;

public class Tiger {
 public static void main(String[] args) {   
  int marks[] = {44,55,88,99,66,44};   
  int totalmarks = 0;
  for(int counter = 0; counter < marks.length; counter++){
   totalmarks += marks[counter];
  }
  System.out.println("Total marks is "+totalmarks);   
  }
}