Array length

Anonymous Arrays

forex gft The main objective of anonymous arrays is just for temporary usage. We can create an anonymous arrays as follows. العاب بيع اسهم Example:

التجارة في الذهب class Test{ public static void main(String arg[]){ System.out.println(sum(new int[]{10,20,30,40})); } public static int sum(int[] a){ int total = 0; for(int i = 0; i< a.length;i++){ total = total + a[i]; } return total; } }