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

Arrays of objects

 
Paul Baker
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to create an array of two objects, one object will be an instance and the other object will be the occurance of that instance. I forget how to send these two objects of different types into the array.
 
Shivaji Marathe
Ranch Hand
Posts: 203
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post your code here?
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you mean that one will be the name of the class and the other will be an object of that class?
Object [][]myArray = new Object[][];
Then you can do
WhateverClass myObj = new WhateverClass();
myArray[0][0] = "WhateverClassName";
myArray[0][1] = myObj;
etc.
[ February 05, 2002: Message edited by: Cindy Glass ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic