Share Pastebin
Guest
Public paste!

Mani S

By: a guest | Jul 4th, 2009 | Syntax: Java | Size: 0.43 KB | Hits: 24 | Expires: Never
Copy text to clipboard
  1. import java.io.*;
  2. class TwoD
  3. {
  4. public static void main(String args[])throws IOException
  5. {
  6.  
  7. int i,j;
  8. char[][] a=new char[3][3];
  9. for(i=0;i<3;i++)
  10. {
  11. for(j=0;j<3;j++)
  12. {
  13. System.out.println("Enter the character at a["+i+"]["+j+"]");
  14. a[i][j]=(char)System.in.read();
  15. }
  16. }
  17.  
  18. for(i=0;i<3;i++)
  19. {
  20. for(j=0;j<3;j++)
  21. {
  22. System.out.println(a[i][j]);
  23. }
  24. }
  25.  
  26. }
  27. }