aspose file tools*
The moose likes Java in General and the fly likes doubt in passing  a two dimensional array from one class to another Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "doubt in passing  a two dimensional array from one class to another" Watch "doubt in passing  a two dimensional array from one class to another" New topic
Author

doubt in passing a two dimensional array from one class to another

Arul Jose
Ranch Hand

Joined: Jan 14, 2005
Posts: 131
class probabilityMatrix
{
double[][] getMatrix()
{
double[][] arr = new double[][];
// array manipulation
return arr;
}
}

class page
{
void meth1()
{
probabilityMatrix a1 = new probabilityMatrix();
double d[][]=a1.getMatrix();
//print d[][];
}
}

This is what i have done in one of my programs. but it is showing the following error. i need help.


C:\Documents and Settings\Aruljose\Desktop>java page
Exception in thread "main" java.lang.NullPointerException
at probabilityMatrix.getMatrix(page.java:62)
at page.main(page.java:269)
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

"jose jose", please see the warning about your display name here.
shandilya popuru
Ranch Hand

Joined: Dec 21, 2004
Posts: 95
ur class does not have a main method


sandy
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

"jose",
Thank you for taking the time to change your display name, but unfortunately it is still not valid.

We require your display name to be two words: your first name, a space, then your last name.

Please try again.

Thanks,
Dave.
 
 
subject: doubt in passing a two dimensional array from one class to another