0

I am trying to pass 2d array as object in MPJ library but it gives error at this line

Object sendobject = new Object[1];
sendobject[0] = (Object)g.adjMatrix;  
//Graph g = new Graph();
// adjmatrix is public member of class Graph having detail of 
// connecting nodes to each other 

Im currently follow the example of this blog.

jessehouwing
  • 106,458
  • 22
  • 256
  • 341

1 Answers1

0

I am not sure, why you create an array with one element, but this:

Object sendobject = new Object[1];  

does not work. Either you want an array:

Object[] sendobject = new Object[1];  

or you want only one Object

Object sendobject = (Object)g.adjMatrix; 
MrSmith42
  • 9,961
  • 6
  • 38
  • 49