heres the code which does exactly what u want. u may modify it so that
it looks better eg aray sizes should be hardcoded etc
the code is displays the output on the standard outout which is the
console.
public class AddArray
{
public static void main(String[] args)
{
int a[]= {1,2,3,4,5};
int b[]= {9,2,4,7,1};
/* I want to add this whole array to my final output will be
10, 4, 7, 11, 6
*/
int c[] = new int[5];
for (int i = 0; i < 5; i++)
{
c[i] = a[i] + b[i];
}
for (int i = 0; i < 5; i++) System.out.println(c[i]);
}
}