Home
Tutorials
Core Java
Introduction To Java
Java Evolution
Overview of Java
Constants, Variables and Data Types
Java Operators
Branching Statements
Looping Statements
Classes, Objects and Methods
Inheritance
Array, String and Vectors
Java Interfaces
Java Packages
Applet Programming
Graphics Programming
Advanced Java
Java AWT
Java Event Handling
Java File Handling
Java MultiThreading
Java Swing-I
Java Swing-II
Exception Handling
Socket Programming
Java Database
Java RMI
Java Servlets
Java Beans
Programms
Projects
Downloads
Contact
Java Programming
!doctype>
Two Dimensional Array in Java
/* =========================================================== File Name : TwoDimensionalArray.java WebSite : http://javaproglang.blogspot.in/ Facebook : https://www.facebook.com/AdvanceJavaProgramming Twitter : https://twitter.com/AdvanceJava Created By : Bintu Chaudhary =========================================================== */ import java.io.*; class TwoDimensionalArray { public static void main(String args[]) throws Exception { int a[][] = new int[2][3]; int sum = 0; String n; int r,c; System.out.println("Enter the Elements"); BufferedReader obj=new BufferedReader(new InputStreamReader(System.in)); for(r=0;r< 2; r++) { for(c=0; c< 3; c++) { n = obj.readLine(); a[r][c]=Integer.parseInt(n); } } System.out.println("After the Inputting"); for(r=0; r< 2; r++) { for(c=0; c < 3; c++) { System.out.println("\t" +a[r][c]); sum = sum + a[r][c]; } System.out.println("\n"); } System.out.println("Sum="+sum); } }
Download Complete Program
-
Read more »
1 comment:
Venkatesh CS
June 13, 2019 at 10:52 PM
This information is really useful to me.Thanks.
Java Training in Chennai
Reply
Delete
Replies
Reply
Add comment
Load more...
This information is really useful to me.Thanks.
ReplyDeleteJava Training in Chennai