chriscct7

Java 2d

Apr 6th, 2012
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.64 KB | None | 0 0
  1. import java.util.Arrays;
  2.  
  3. class retArrExample {
  4.     retArrExample()    {
  5.         //declare & initialize array
  6.         int numOfTutors=4;
  7.         int numOfDays=3;    
  8.         new int [numOfTutors][numOfDays] tutorData;
  9.         int[][] tutorData = { {25,3,0}, {14, 5, 12},{33, 22, 10},{0,20,5}};
  10.        
  11.        
  12.         for (int i = 0; i < tutorData.length; i++)    {
  13.             // The inner loop executes as long as there are elements in row i
  14.             for (int j = 0; j < tutorData[i].length; j++){
  15.                 System.out.print(tutorData[i][j] + "  ");
  16.             }
  17.             System.out.println();
  18.         }
  19.         System.out.println();
Advertisement
Add Comment
Please, Sign In to add comment