//main method
int number = 1;
int num = 3;
details[] Darray = new details[number][num];
String name = JOptionPane.showInputDialog(null,
"Enter the name",
"Enter details",
JOptionPane.QUESTION_MESSAGE);
String DOB = JOptionPane.showInputDialog(null,
"Enter the DOB",
"Enter details",
JOptionPane.QUESTION_MESSAGE);
class details
// i have default construtors aswell
String getName(){
return name;
}
heres the problem - i was told that you are only ment to input data in the main method. I need a 2d array to store many people info.
I tried Darray[0] = name;
but this came up
C:\Documents and Settings\java:34: incompatible types
found : java.lang.String
required: details
since classes are ment to store information (possibley privately) I was wondering the easiest way to store it in a array and pass it. I also want to use the array in the main method after the have finished storing it.
any ideas?
thanks for looking