Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. import java.io.*;
  2.  
  3. class generate{
  4. public String twoDArray(){
  5. int[][] myArray = {{1, 5}, {2, 3}, {4, 6}};
  6.  
  7.  
  8. String hi = "";
  9. hi += "myArray[0][0]="+myArray[0][0]+"\r\n";
  10. hi += "myArray[0][1]="+myArray[0][1]+"\r\n";
  11. hi += "myArray[1][0]="+myArray[1][0]+"\r\n";
  12. hi += "myArray[1][0]="+myArray[2][0]+"\r\n";
  13. hi += "myArray.length="+myArray.length+"\r\n";
  14. hi += "myArray[0].length="+myArray[0].length+"\r\n";
  15.  
  16. return hi;
  17. }
  18.  
  19. }
  20.  
  21. class main{
  22. public static void main(String args[]){
  23. generate sGenerate = new generate();
  24. System.out.print(sGenerate.twoDArray());
  25.  
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement