This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Pass 2D array between methods

 
Ralph King
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
all,

I am struggling to pass my 2D array between classes. The following getMethod should return a valid 2D array:

public String[][] getResults(){
return (resultSet);
}


However when i try to access from another class my first attempts fall woefully short:

String test[][]=newData.getResults();

When I try to access elements they are all null. how do i accomplish this?

All help very welcome.
 
Rob Spoor
Sheriff
Pie
Posts: 20380
46
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch!

Where and how have you initialized resultSet?
 
Campbell Ritchie
Sheriff
Pie
Posts: 47258
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome again

I am afraid I am going pedantic: there is no such thing in Java™ as a 2D array. There are arrays of arrays, however.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic