Dear all,
I have a Matrix Program which I need to add, multiply, subtract.
I have a Matrix Class of the following
public class Matrix{
double [][]elements;
public add(Matrix x);
public subtract(Matrix x);
}
I have a MatrixMain program which is reponsible for showing the menu for the above operations. eg(1) Add, (2) Multiply, (3)Subtract (4)Exit
I have problem making my program Object Oriented. This is wat I did
public class MatrixMain{
public static void main(
String args[])
{
Matrix a = new a();
......
i = showMenu();
switch(i)
{
case 1: option1();//add
case 2: option2();//multiply
.....
}
public static option1()
{
//Do adding here....
//Get error for accessing Matrix a here
}
}
is there a way to make my program OO? Thanks
alot