Class question
in
Programming Questions
•
1 years ago
I hava a class, say Object. Made an array of that. One of the numbers i need for making this class display method is the sum of all determined field in the array, like
Object[] o = new Object[
n];
///initialize and all the rest...
class Object
{
float
value;
/// constructor and methods
void display()
{
rect(sumof o[]'s
values fields,y,sz,sz);
}
}
I can't do that, can I? Unless i provide this value as an field in void(float value). But this seems strange dont it? Or better use a display(Object[] o)... hummm ???
1