Programming tutorials online .NET, Java, C++, Visual Basic, and More
 

Home
.NET Tutorials
General Programming Tutorials
Community/Forums
Site Extras

 

Java/J2EE Forum
 

Open forum for discussing anything Java related. J2EE, JSPs, servlets, EJBs, JDBC, its all fair game and can be found in the Java/J2EE forum!


POST REPLY
Posted By: oremprakash   3/6/2007 1:49:00 AM
Reply To: saurab who posted...
 
public class Addition {
public static void main(String args[]) {
int sum = 0;
int nums[][] = new int[3][5];

// give nums some values
for (int i = 0; i for (int j = 0; j nums[i][j] = (i + 1) * (j + 1);

// use for-each for to display and sum the values
for (int x[] : nums) {
for (int y : x) {
System.out.println("Value is: " + y);
sum += y;
}
}
System.out.println("Summation: " + sum);
}
}



i hope this may be useful to u.....
dont copy the code and run...

analyse the code and try to do by ur own....
regards,
Prakash.M



 
Sign In
Email
Password
  Forgot my password

Search

Featured Book

Introducing Microsoft .Net, Third Edition ($19.79)
Introducing Microsoft .Net, Third Edition


Featured Software

Microsoft Visual Studio Standard 2005 ($249.99)
Microsoft Visual Studio Standard 2005