Welcome to the community Crawler
first of all you should use the code tags when you post code
after a brief look to your code I would like to point you a few things
1)You have declared four instance variables but there is no constructor method.Either add a constructor method named like the name of your class like this
CODE
public ArraySum(argsuments if needed)
{
//code if needed
}
In this case you have to change the name of the function you have already written
You don't have to write a constructor method.However if you want the instance variables to be used properly you have to create an object that is the same type with your class.You can write inside main the following
CODE
ArraySum ar =new ArraySum();
The object must be created either way
2)In the function you have calculating the sum there is no return.You want some tob returned so at the bottom of your function add
CODE
return sum;
3)Now if you want the sum to be calculated you have to make a call to the function that calculates the sum using the object you have created.So inside main write this
CODE
sum=ar.ArraySum(arguments);
//ArraySum here is the function you have written
I hope I have helped
This post has been edited by chuck87: 6 Feb, 2008 - 05:03 AM